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

Add doc examples for Iter and IterMut #32768

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Conversation

GuillaumeGomez
Copy link
Member

Fixes #29374.

r? @steveklabnik

/// Basic usage:
///
/// ```
/// // First, we declare a type which implements `IterMut` trait (&[usize here]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IterMut is a struct, not a trait.

@steveklabnik
Copy link
Member

---- slice::IterMut<'a, T>::into_slice_0 stdout ----
    <anon>:10:27: 10:35 error: no method named `as_slice` found for type `std::slice::IterMut<'_, _>` in the current scope
<anon>:10     println!("{:?}", iter.as_slice());
                                    ^~~~~~~~
<std macros>:2:25: 2:56 note: in this expansion of format_args!
<std macros>:3:1: 3:54 note: in this expansion of print! (defined in <std macros>)
<anon>:10:5: 10:39 note: in this expansion of println! (defined in <std macros>)
<anon>:14:27: 14:35 error: no method named `as_slice` found for type `std::slice::IterMut<'_, _>` in the current scope
<anon>:14     println!("{:?}", iter.as_slice());
                                    ^~~~~~~~
<std macros>:2:25: 2:56 note: in this expansion of format_args!
<std macros>:3:1: 3:54 note: in this expansion of print! (defined in <std macros>)
<anon>:14:5: 14:39 note: in this expansion of println! (defined in <std macros>)
error: aborting due to previous error(s)
thread 'slice::IterMut<'a, T>::into_slice_0' panicked at 'Box<Any>', src/librustc/session/mod.rs:161
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    slice::IterMut<'a, T>::into_slice_0

from Travis

@GuillaumeGomez
Copy link
Member Author

That's what I saw, bad c/c I guess. :-/

@GuillaumeGomez
Copy link
Member Author

I changed the examples. Do you find them better?

@@ -1 +1 @@
Subproject commit 7265c17d1845354f979a39b4ceb3a6934025b2ab
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this snuck in!

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Apr 8, 2016

📌 Commit 4a28dac has been approved by steveklabnik

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Apr 8, 2016

📌 Commit 69289c9 has been approved by steveklabnik

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 9, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Apr 11, 2016
bors added a commit that referenced this pull request Apr 11, 2016
Rollup of 9 pull requests

- Successful merges: #32768, #32802, #32815, #32823, #32849, #32854, #32862, #32870, #32873
- Failed merges:
@bors bors merged commit 69289c9 into rust-lang:master Apr 12, 2016
@GuillaumeGomez GuillaumeGomez deleted the slice_doc branch April 12, 2016 09:27
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

Successfully merging this pull request may close these issues.

3 participants