Skip to content

Rollup of 6 pull requests #34073

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 26 commits into from
Closed

Conversation

srinivasreddy and others added 3 commits May 30, 2016 22:28
The previous version of the chapter covered a lot of ground, but was a little
meandering and hard to follow at times. This draft is intended to be clearer
and more direct, while still providing the same information as the previous
version.
@rust-highfive
Copy link
Contributor

r? @pnkfelix

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

@Manishearth
Copy link
Member Author

@bors r+ p=20

@bors
Copy link
Collaborator

bors commented Jun 4, 2016

📌 Commit decb264 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Jun 4, 2016

⌛ Testing commit decb264 with merge 8a9e1ed...

@bors
Copy link
Collaborator

bors commented Jun 4, 2016

💔 Test failed - auto-win-msvc-64-opt

@Manishearth
Copy link
Member Author

@bors retry

configure: CFG_CMAKE            := /mingw64/bin/cmake (3.2.1)
ERROR: The system was unable to find the specified registry key or value.
configure: CFG_MSVC_ROOT        := C:\Program Files (x86)\Microsoft Vi ...

@Manishearth
Copy link
Member Author

Oh, it timed out

@bors
Copy link
Collaborator

bors commented Jun 4, 2016

⌛ Testing commit decb264 with merge 750f18a...

@bors
Copy link
Collaborator

bors commented Jun 4, 2016

💔 Test failed - auto-linux-64-opt

srinivasreddy and others added 15 commits June 5, 2016 11:53
The book's "Error handling with Box<Error>" section talks about Box<Error>.
In the actual example Box<Error + Send + Sync> is used instead so that the
corresponding From impls could be used to convert a plain string to an error
type. Rust 1.7 added support for conversion from &str/String to
Box<Error>, so this gotcha and later references to it can now be removed.
…nor gather flags for untracked content.

(Includes a regression test, which needed to go into `compile-fail/`
due to weaknesses when combining `#[deny(warnings)]` with
`tcx.sess.span_warn(..)`)

(updated with review feedback from arielb1.)
Rewrote "How Safe and Unsafe Interact" Nomicon chapter.

The previous version of the chapter covered a lot of ground, but was a little meandering and hard to follow at times. This draft is intended to be clearer and more direct, while still providing the same information as the previous version.

r? @steveklabnik
…umeGomez

run rustfmt on librustc_lint folder
Fix wrong statement in compare_exchange doc

The documentation for `core::sync::atomic::AtomicSomething::compare_exchange` contains a wrong, or imprecise, statement about the return value. It goes:

The return value is a result indicating whether the new value was written and containing
the previous value. On success this value is guaranteed to be equal to `new`.

In the second sentence, `this value` is gramatically understood as referring to `return value` from the first sentence. Due to how CAS works, the returned value is always what was in the atomic variable _before_ the operation occurred, not what was written into it during the operation. Hence, the fixed doc should say:

The return value is a result indicating whether the new value was written and containing
the previous value. On success this value is guaranteed to be equal to `current`.

This version is confirmed by the runnable examples in variants of `AtomicSomething`, e.g.

    assert_eq!(some_bool.compare_exchange(true, false, Ordering::Acquire, Ordering::Relaxed),
    Ok(true));

where the returned value is `Ok(current)`. This PR fixes all occurrences of this bug I could find.

An alternative solution would be to modify the second sentence so that it refers to the value _written_ into the Atomic rather than what was there before, in which case it would be correct. Example alternative formulation:

On success the value written into the `bool`/`usize`/`whatever` is guaranteed to be equal to `new`.

r? @steveklabnik
run rustfmt on map.rs in libcollections/btree folder
…n, r=nrc

Refactor away the prelude injection fold

Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`.

r? @nrc
Fix issue rust-lang#34101

Fix issue rust-lang#34101: do not track subcontent of type with dtor nor gather flags for untracked content.

(Includes a regression test, which needed to go into `compile-fail/`
due to weaknesses when combining `#[deny(warnings)]` with
`tcx.sess.span_warn(..)`)
…veklabnik

Remove a gotcha from book/error-handling.md

The book's "Error handling with `Box<Error>`" section talks about `Box<Error>`. In the actual example `Box<Error + Send + Sync>` is used instead so that the corresponding From impls could be used to convert a plain string to an error type. Rust 1.7 added support for conversion from `&str`/`String` to
`Box<Error>`, so this gotcha and later references to it can now be removed.

r? @steveklabnik
Add explanations for E0503 and E0508.

(cannot use `..` because it was mutably borrowed, cannot move out of type `..`, a non-copy fixed-size array)

Part of rust-lang#32777.
docs: simplify wording

It took me more then a moment to decipher "with no non-`'static`" thing :)

"`'static` type" should say the same thing more clearly.

r? @steveklabnik
@Manishearth
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Collaborator

bors commented Jun 8, 2016

📌 Commit c7b9ee2 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Jun 8, 2016

⌛ Testing commit c7b9ee2 with merge ab7d405...

@bors
Copy link
Collaborator

bors commented Jun 8, 2016

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

@bors
Copy link
Collaborator

bors commented Jun 9, 2016

☔ The latest upstream changes (presumably #32202) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.