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

Typo fixes #556

Merged
merged 9 commits into from
Mar 28, 2019
Merged

Typo fixes #556

merged 9 commits into from
Mar 28, 2019

Conversation

awaitlink
Copy link
Contributor

@awaitlink awaitlink commented Mar 28, 2019

Fixes various typos.

@awaitlink awaitlink changed the title Fix wrong path in expressions/operator-expr.md Fixes in expressions/operator-expr.md Mar 28, 2019
@awaitlink awaitlink changed the title Fixes in expressions/operator-expr.md Fixes in expressions/{operator,match}-expr.md Mar 28, 2019
@awaitlink awaitlink changed the title Fixes in expressions/{operator,match}-expr.md Typo fixes Mar 28, 2019
src/type-coercions.md Outdated Show resolved Hide resolved
src/type-coercions.md Outdated Show resolved Hide resolved
@Centril Centril self-assigned this Mar 28, 2019
@@ -110,7 +110,7 @@ according to the following rules:
closure that captures a `T` by shared reference and a `U` by value implements
any auto traits that both `&T` and `U` do.

For generic types (counting the built-in types above as generic over `T`), if an
For generic types (counting the built-in types above as generic over `T`), if a
generic implementation is available, then the compiler does not automatically
implement it for types that could use the implementation except that they do not
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Centril Perhaps this can be re-phrased? I can't seem to understand what the except that they do not meet... part means. Does that mean except if they or except then they...

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider:

struct A<T>(T);

unsafe impl<T: Copy> Send for A<T> {}

fn assert_send<T: Send>() {}

fn main() {
    assert_send::<A<u8>>();
    assert_send::<A<String>>();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the compiler would have done this (and does so if we comment out our unsafe impl):

unsafe impl Send for A<String> {}
// as part of:
unsafe impl Send for A<T> where T: Send {}

But our unsafe impl tells the compiler to disregard its auto trait rules and instead use our "rule" (impl), i.e. we tell the compiler that it is not safe to Send values of type A<T> unless T: Copy?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, pretty much.

@awaitlink
Copy link
Contributor Author

@Centril I think this is ready for merging now.

@Centril
Copy link
Contributor

Centril commented Mar 28, 2019

Yep; Thanks!

@Centril Centril merged commit c507a9e into rust-lang:master Mar 28, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 6, 2019
Update books

## nomicon

1 commits in f1ff93b66844493a7b03101c7df66ac958c62418..c02e0e7754a76886e55b976a3a4fac20100cd35d
2019-02-26 13:37:28 -0500 to 2019-03-25 16:52:56 -0400
- dropck: The drop order is now defined (rust-lang/nomicon#113)

## reference

3 commits in 27ad493..98f90ff
2019-03-26 02:06:15 +0100 to 2019-04-06 09:29:08 -0700
- Document repr packed(N). (rust-lang/reference#553)
- Fix broken link in glossary. (rust-lang/reference#558)
- Typo fixes (rust-lang/reference#556)

## embedded-book

2 commits in 07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a..7989c723607ef5b13b57208022259e6c771e11d0
2019-03-27 15:40:52 +0000 to 2019-04-04 12:14:37 +0000
- fix rust-embedded/book#182  (rust-embedded/book#183)
- Add openocd to list of installable packages  (rust-embedded/book#179)
Centril added a commit to Centril/rust that referenced this pull request Apr 6, 2019
Update books

## nomicon

1 commits in f1ff93b66844493a7b03101c7df66ac958c62418..c02e0e7754a76886e55b976a3a4fac20100cd35d
2019-02-26 13:37:28 -0500 to 2019-03-25 16:52:56 -0400
- dropck: The drop order is now defined (rust-lang/nomicon#113)

## reference

3 commits in 27ad493..98f90ff
2019-03-26 02:06:15 +0100 to 2019-04-06 09:29:08 -0700
- Document repr packed(N). (rust-lang/reference#553)
- Fix broken link in glossary. (rust-lang/reference#558)
- Typo fixes (rust-lang/reference#556)

## embedded-book

2 commits in 07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a..7989c723607ef5b13b57208022259e6c771e11d0
2019-03-27 15:40:52 +0000 to 2019-04-04 12:14:37 +0000
- fix rust-embedded/book#182  (rust-embedded/book#183)
- Add openocd to list of installable packages  (rust-embedded/book#179)
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.

2 participants