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 9 pull requests #25888

Merged
merged 60 commits into from
May 30, 2015
Merged

Rollup of 9 pull requests #25888

merged 60 commits into from
May 30, 2015

Conversation

SimonSapin and others added 30 commits May 24, 2015 10:38
`core::cell::Cell<T>` and `core::cell::RefCell<T>` currently implement
`PartialEq` when `T` does, and just defer to comparing `T` values.
There is no reason the same shouldn’t apply to `Eq`.

This enables `#[derive(Eq, PartialEq)]` on e.g.
structs that have a `RefCell` field.
error::Error itself has downcasting methods, so there's no need to
duplicate those here.
Ergonomics are a bit crappy right now because method resolution isn't
smart enough to drop bounds, unfortunately.
This is now std::io::Result
Use a struct called Hole that keeps track of an invalid location
in the vector and fills the hole on drop.

I include a run-pass test that the current BinaryHeap fails, and the new
one passes.

Fixes rust-lang#25842
collections: Make BinaryHeap panic safe in sift_up / sift_down

Use a struct called Hole that keeps track of an invalid location
in the vector and fills the hole on drop.

I include a run-pass test that the current BinaryHeap fails, and the new
one passes.

NOTE: The BinaryHeap will still be inconsistent after a comparison fails. It will
not have the heap property. What we fix is just that elements will be valid
values.

This is actually a performance win -- the new code does not bother to write in `zeroed()`
values in the holes, it just leaves them as they were.

Net result is something like a 5% decrease in runtime for `BinaryHeap::from_vec`. This
can be further improved by using unchecked indexing (I confirmed it makes a difference,
not a surprise with the non-sequential access going on), but let's leave that for another PR.
Safety first 😉 

Fixes rust-lang#25842
…::Ref

... and generalize the bounds on the value type.
There was no opening parenthesis for this closing parenthesis...
`core::cell::Cell<T>` and `core::cell::RefCell<T>` currently implement `PartialEq` when `T` does, and just defer to comparing `T` values. There is no reason the same shouldn’t apply to `Eq`.

This enables `#[derive(Eq, PartialEq)]` on e.g. structs that have a `RefCell` field.

r? @alexcrichton 

I’m unsure what to do with `#[stable]` attributes on `impl`s. `impl`s generated by `#[derive]` don’t have them.
"workd" corrected to "world"
A discussion at rust-lang#25832 established what
the abbreviations mean.
The current version of hoedown treats lists interrupting paragraphs in the Markdown.pl style rather than CommonMark, so a newline is needed for the list to be rendered properly.
"Idiomatic code should not use extra whitespace in the middle of a line to provide alignment."
nikomatsakis and others added 15 commits May 29, 2015 09:42
…lls, r=alexcrichton

The previous feature gate assumed we would not define any (stable) const fns. But then @eddyb went and cleaned up the code. So this now extends the feature-gate to prohibit calls; but calls inside of macros are considered ok.

r? @alexcrichton
This adds an example from mem::swap, and provides some suggested uses of this
function.

This is my attempt to summarize the answers to a question I asked on reddit http://www.reddit.com/r/rust/comments/37jcul/what_is_forget_for/ and add the answers to the documentation so that no one else has to google or ask the question again.
There was no opening parenthesis for this closing parenthesis...
…abnik

So that rust-guidelines can be deleted and src/doc/style can prosper as the official home of the rust guidelines. 😃
The E0397 explanation, as I've written it, isn't really an explanation, but I'm not sure what to put here. I will happily take suggestions.

Partially addresses rust-lang#25851
@rust-highfive
Copy link
Collaborator

r? @Aatch

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

@steveklabnik
Copy link
Member Author

@bors: r+ p=1 force

@bors
Copy link
Contributor

bors commented May 29, 2015

📌 Commit ed19a6e has been approved by steveklabnik

@steveklabnik steveklabnik assigned steveklabnik and unassigned Aatch May 29, 2015
@steveklabnik
Copy link
Member Author

@bors: force

@bors
Copy link
Contributor

bors commented May 29, 2015

⌛ Testing commit ed19a6e with merge b77d60a...

bors added a commit that referenced this pull request May 29, 2015
@bors
Copy link
Contributor

bors commented May 29, 2015

💔 Test failed - auto-linux-64-nopt-t

@steveklabnik
Copy link
Member Author

@bors: retry force

@bors
Copy link
Contributor

bors commented May 29, 2015

@bors bors merged commit ed19a6e into rust-lang:master May 30, 2015
@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.