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

ices/95134.sh: fixed with errors #1397

Merged
merged 1 commit into from
Aug 23, 2022
Merged

ices/95134.sh: fixed with errors #1397

merged 1 commit into from
Aug 23, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#95134

rustc --edition=2021 - 2>&1 << EOF

pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
    if n > 15 {
        encode_num(n / 16, &mut writer)?;
    }
    Ok(())
}

pub trait ExampleWriter {
    type Error;
}

impl<'a, T: ExampleWriter> ExampleWriter for &'a mut T {
    type Error = T::Error;
}

struct EmptyWriter;

impl ExampleWriter for EmptyWriter {
    type Error = ();
}

fn main() {
    encode_num(69, &mut EmptyWriter).unwrap();
}

EOF
=== stdout ===
error[E0275]: overflow evaluating the requirement `<EmptyWriter as ExampleWriter>::Error`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`rust_out`)

error: aborting due to previous error

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

=== stdout ===
error[E0275]: overflow evaluating the requirement `<EmptyWriter as ExampleWriter>::Error`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`rust_out`)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
=== stderr ===
==============
@JohnTitor JohnTitor merged commit 75d2de9 into master Aug 23, 2022
@JohnTitor JohnTitor deleted the autofix/ices/95134.sh branch August 23, 2022 09:36
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