Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

each_char conflict in str::StrSlice and io::ReaderUtil #5664

Closed
sbillig opened this issue Apr 1, 2013 · 2 comments
Closed

each_char conflict in str::StrSlice and io::ReaderUtil #5664

sbillig opened this issue Apr 1, 2013 · 2 comments

Comments

@sbillig
Copy link

sbillig commented Apr 1, 2013

This code fails to compile:

use core::str::*;
fn main() {
    let s = ~"hello";
    // Works:
    each_char(s, |_| {true});
    // Fails:
    s.each_char(|_| {true});
    // Fails:
    for s.each_char |_| {}
}

error: failed to find an implementation of trait core::io::Reader for <V2>

@Dretch
Copy link
Contributor

Dretch commented Apr 7, 2013

I ran into this too - I think it might be the same bug as #4270.

@msullivan
Copy link
Contributor

Ok, so, each_char the function no longer seems to exist, and the each_char method for StrSlice no longer exists. The test still fails, since there is no Reader implementation, but that seems right.

So I'm closing this.

tesuji pushed a commit to tesuji/rustc that referenced this issue Jun 4, 2020
Give corrected code

This PR adds corrected code for doc examples.

I did this in several commits to facilitate review.
Don't hesitate to tell me if I forgot some.
Also, sometimes I felt it was not necessary to give corrected code, but I maybe wrong.

fixes: rust-lang#4829

changelog: Improve documentation examples across multiple lints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants