-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[doc] note the special type inference handling for shift ops #49915
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Looks like a reasonable documentation update to me. Could I get confirmation from @rust-lang/lang on the accuracy of the comment? |
FWiW, I've also written up a blog post on the distinction and how I happened upon it. |
@bors r+ rollup |
📌 Commit a7e3d85 has been approved by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to avoid the jargon typeck in user facing documentation.
src/libcore/ops/bit.rs
Outdated
@@ -315,7 +315,12 @@ macro_rules! bitxor_impl { | |||
|
|||
bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } | |||
|
|||
/// The left shift operator `<<`. | |||
/// The left shift operator `<<`. Note that because this trait is implemented | |||
/// for all integer types with multiple right-hand-side types, typeck has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/typeck/Rust's type checker/
src/libcore/ops/bit.rs
Outdated
@@ -417,7 +422,12 @@ macro_rules! shl_impl_all { | |||
|
|||
shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 } | |||
|
|||
/// The right shift operator `>>`. | |||
/// The right shift operator `>>`. Note that because this trait is implemented | |||
/// for all integer types with multiple right-hand-side types, typeck has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/typeck/Rust's type checker/
On April 12, 2018 3:53:02 PM PDT, Mazdak Farrokhzad ***@***.***> wrote:
Centril commented on this pull request.
We probably want to avoid the jargon typeck in user facing
documentation.
> @@ -315,7 +315,12 @@ macro_rules! bitxor_impl {
bitxor_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128
}
-/// The left shift operator `<<`.
+/// The left shift operator `<<`. Note that because this trait is
implemented
+/// for all integer types with multiple right-hand-side types, typeck
has
s/typeck/Rust's type checker/
> @@ -417,7 +422,12 @@ macro_rules! shl_impl_all {
shl_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 isize i128 }
-/// The right shift operator `>>`.
+/// The right shift operator `>>`. Note that because this trait is
implemented
+/// for all integer types with multiple right-hand-side types, typeck
has
s/typeck/Rust's type checker/
Good point!
|
@kennytm can I |
@llogiq I've removed this PR from the rollup. Feel free to change anything. |
I've replaced 'typeck' with 'the Rust type checker'. This should now be good to go. |
@bors r=joshtriplett |
📌 Commit b744e3d has been approved by |
[doc] note the special type inference handling for shift ops This adds a note to the docs about the difference between the shift ops and the corresponding trait methods when it comes to type inference.
This adds a note to the docs about the difference between the shift ops and the corresponding trait methods when it comes to type inference.