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

Rollup of 16 pull requests #36126

Merged
merged 38 commits into from Aug 30, 2016
Merged

Rollup of 16 pull requests #36126

merged 38 commits into from Aug 30, 2016

Conversation

matthew-piziak and others added 21 commits August 20, 2016 13:28
Feedback on PR rust-lang#35701 seems to be positive, so this does the same thing for `RangeTo` and `RangeToInclusive`.
Doing otherwise would break traits like `ToString`.
They're the same thing but it's better to keep the terminology consistent.
I can think of a few things we may want to accomplish with the documentation of the `Fn`, `FnMut`, and `FnOnce` traits:
- the relationship between these traits and the closures that implement them
- examples of non-closure implementations
- the relationship between these traits and Rust's ownership semantics

add module-level documentation for `Fn*` traits

Describe how `Fn*` traits, closure types, and ownership semantics are
linked, and provide examples of higher-level functions that take `Fn*`s.

more examples for `Fn*` traits

create correct (though not yet elegant) examples for `FnMut` and `FnOnce`

add trait links to module-level documentation

third time's a charm!

argument -> capture for trait documentation

This wording will need to be supported with better examples for
capturing eventually.

correct `FnOnce` example

I also fixed some of the trait wording here to make the concept of
capturing clearer; though that still needs more work.

replace `x + x` with `x * 2` for `fn double`
r? @steveklabnik

add examples that lift `<<` and `>>` to a trivial struct

replace `Scalar` structs with struct tuples

add `fn main` wrappers to enable Rust Playground "Run" button
The affected API apparently had changed with commit d59accf.
This pull request is based on the discussion in PR rust-lang#35927.

Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.

Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.

Make `BooleanVector` a struct tuple.

Derive `PartialEq` for `BooleanVector` instead of implementing it.

Adds a `fn main` wrapper so that the example can integrate with Rust Playground.

simplified bitand expression

add a comment explaining what "rhs" means
This can be confusing for newcomers, especially due to the argument
name "this".
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@GuillaumeGomez
Copy link
Member Author

@bors: r+ p=1

@bors
Copy link
Contributor

bors commented Aug 30, 2016

📌 Commit 2217fc5 has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Aug 30, 2016

⌛ Testing commit 2217fc5 with merge badf406...

bors added a commit that referenced this pull request Aug 30, 2016
@bors
Copy link
Contributor

bors commented Aug 30, 2016

💔 Test failed - auto-mac-64-opt-rustbuild

@TimNN TimNN mentioned this pull request Aug 30, 2016
@TimNN
Copy link
Contributor

TimNN commented Aug 30, 2016

Failure was linkchecker for #35759.

Doc: explain why Box/Rc/Arc methods do not take self

This can be confusing for newcomers, especially due to the argument name `this` that is used for Rc and Arc.
…ple-error, r=steveklabnik

show how iterating over `RangeTo` and `RangeToInclusive` fails

Feedback on PR rust-lang#35701 seems to be positive, so this does the same thing for `RangeTo` and `RangeToInclusive`.
…steveklabnik

improve documentation for `Fn*` traits

This PR is not yet a serious attempt at contribution. Rather, I'm opening this for discussion. I can think of a few things we may want to accomplish with the documentation of the `Fn`, `FnMut`, and `FnOnce` traits:
- the relationship between these traits and the closures that implement them
- examples of non-closure implementations
- the relationship between these traits and Rust's ownership semantics
Clarify/fix formatting docs concerning fmt::Result/fmt::Error

1. `fmt::Result` != `io::Result<()>`
2. Formatters should only propagate errors, not return their own.

Confusion on reddit: https://www.reddit.com/r/rust/comments/4yorxr/is_implt_tostring_for_t_where_t_display_sized_a/
…klabnik

add evocative examples for `Shl` and `Shr`

r? @steveklabnik
Fix documentation in cell mod

The implementation of Rc type in this doc is outdated.
…steveklabnik

Updated code sample in chapter on syntax extensions.

The affected API apparently had changed with commit d59accf.

---

Further more I had to add

```toml
[lib]
name = "roman_numerals"
crate-type = ["dylib"]
```

to `Cargo.toml` as I otherwise got this compiler error (despite `#![crate_type="dylib"]`):

    [E0457]: plugin `roman_numerals` only found in rlib format, but must be available in dylib format

Might be worth adding a note about that?
Rename {int,uint} methods to {isize,usize}.

None
…=GuillaumeGomez

improve `BitAnd` trait documentation

This pull request is based on the discussion in PR rust-lang#35927.

Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.

Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.

Make `BooleanVector` a struct tuple.

Derive `PartialEq` for `BooleanVector` instead of implementing it.

Adds a `fn main` wrapper so that the example can integrate with Rust Playground.
…le, r=GuillaumeGomez

add a simple example for `thread::current()`

r? @GuillaumeGomez
…jonathandturner

Update E0194 to new error format

Fixes rust-lang#35280 to update E0194 to support new error message format. Part of rust-lang#35233.

A separate Github issue rust-lang#36057 tracks the bonus portion of the original ticket.

r? @jonathandturner
… r=jonathandturner

Update E0463 error message to new format

Fixes rust-lang#35934 as part of rust-lang#35233

r? @jonathandturner
…rner

Update Error format for E0164, E0165, E0184

Part of rust-lang#35233

r? @jonathandturner
@GuillaumeGomez
Copy link
Member Author

@bors: r+ p=1

@bors
Copy link
Contributor

bors commented Aug 30, 2016

📌 Commit 1d2308f has been approved by GuillaumeGomez

@bors
Copy link
Contributor

bors commented Aug 30, 2016

⌛ Testing commit 1d2308f with merge 4473130...

bors added a commit that referenced this pull request Aug 30, 2016
@bors bors merged commit 1d2308f into rust-lang:master Aug 30, 2016
@GuillaumeGomez GuillaumeGomez deleted the rollup branch August 30, 2016 17:10
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet