Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow T op= &T for built-in numeric types T v2 #44287
Conversation
rust-highfive
assigned
aturon
Sep 3, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Eh2406
referenced this pull request
Sep 3, 2017
Closed
Allow T op= &T for built-in numeric types T #41336
This comment has been minimized.
This comment has been minimized.
|
The
|
This comment has been minimized.
This comment has been minimized.
|
I'm not seeing how to fix the test. It is a very fragile situation in which this test passes. I.E. this |
This comment has been minimized.
This comment has been minimized.
|
The test was introduced in #42634 (comment) (cc @nikomatsakis). Maybe you could just disable the test (add a comment |
This comment has been minimized.
This comment has been minimized.
|
Thanks for suggestion. Let's see what ci thinks. |
arielb1
added
the
S-waiting-on-review
label
Sep 5, 2017
aturon
added
S-waiting-on-crater
and removed
S-waiting-on-review
labels
Sep 6, 2017
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/infra cargobomb requested! |
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Sep 6, 2017
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Started preparing cargobomb run. |
bjorn3
suggested changes
Sep 12, 2017
| x >>= &2i16; | ||
| assert_eq!(x, 0b10u64); | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kennytm
Sep 12, 2017
Member
@Eh2406 Cargobomb uses the compiler already built from @bors try. You could fix it any time you like.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Cargobomb run complete: http://cargobomb-reports.s3.amazonaws.com/pr-44287/index.html. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for running this! I am new to cargobomb, what is the best way to proceed? How can I find the original code, so I can start on Pr's? Any iday how this Pr can lead to a |
This comment has been minimized.
This comment has been minimized.
Usually regressed is the only section you need to pay attention to. Since this change affects type inference, the "test-fail" results likely means the crate's tests are flaky, and can be safely ignored. The list of crates with flaky tests can be found in https://github.com/rust-lang-nursery/cargobomb/blob/master/blacklist.md, rust-lang-nursery/crater#126 and rust-lang-nursery/crater#127. For instance Sometimes even "build-fail" tests are spurious, e.g. However, the error in There are 12 root regressions, much more than the previous try.
|
This comment has been minimized.
This comment has been minimized.
|
I'd also like to note that rust-lang/rfcs#2147 may make this PR unnecessary. |
kennytm
referenced this pull request
Sep 13, 2017
Closed
Some `build-fail`s are wrongly treated as `test-fail`s. #132
This comment has been minimized.
This comment has been minimized.
|
@kennytm: Thanks a lot for the nice summary of the regressions. Does cargobomb test more crates than crater did? Because I find it surprising that there would be more people writing this kind of pattern in the last 3 months than in the 2 years before that. But to answer your remark that "rust-lang/rfcs#2147 may make this PR unnecessary": I don't think that's true. Let me explain: In non-generic code, the problems that this PR solves are indeed also solved by rust-lang/rfcs#2147. This PR helps you if you have an So it looks like that RFC is just a far superior version of this PR. But that's in non-generic code, where this PR only solves some very minor inconveniences. The main use of this PR is in generic code, for the use case where you want to write a generic function that has to work both with built-in numeric types ( So tl;dr: yes rust-lang/rfcs#2147 supersedes this PR for non-generic code, but not in generic code. (I reworked this post a bit because it was inaccurate) |
This comment has been minimized.
This comment has been minimized.
|
@Migi Thank you for the detailed analysis! And yes, cargobomb tests more than crater did. Crater just tried to build all the crates, Cargobomb tries to run all the tests. So the the regressions in test code, like treeflection_derive, would not have been caught by Crater. @kennytm Thank you for the explanation and for doing the triage. I will work on making PR's to fix them later today/as soon as I have time. How can I get rustup to use the try artifact, so I can double check my fixes? |
This comment has been minimized.
This comment has been minimized.
|
@Eh2406 Not sure how to setup rustup for this, but you could download the binaries from |
This comment has been minimized.
This comment has been minimized.
|
https://github.com/Mark-Simulacrum/bisect-rust will download and unarchive a try build, you just need to run |
Eh2406
referenced this pull request
Sep 13, 2017
Closed
Having trouble installing from try build #10
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
arielb1
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Sep 26, 2017
This comment has been minimized.
This comment has been minimized.
|
@bors r- |
This comment has been minimized.
This comment has been minimized.
|
@bors r=aturon rollup |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
|
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
Sep 29, 2017
bors
added a commit
that referenced
this pull request
Sep 30, 2017
bors
added a commit
that referenced
this pull request
Sep 30, 2017
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Merged in #44936. |
Mark-Simulacrum
closed this
Sep 30, 2017
SimonSapin
referenced this pull request
Oct 1, 2017
Merged
Upgrade to rustc 1.22.0-nightly (c6884b12d 2017-09-30) #18693
This comment has been minimized.
This comment has been minimized.
|
This broke Servo: error[E0283]: type annotations required: cannot resolve `usize: core::ops::AddAssign<_>`
--> /home/travis/build/servo/servo-with-rust-nightly/servo/components/script/textinput.rs:239:31
|
239 | |len, slice| *len += slice.chars().map(char::len_utf16).sum())
| ^^
error: aborting due to previous error(Using |
This comment has been minimized.
This comment has been minimized.
|
ollie27
referenced this pull request
Oct 23, 2017
Closed
Type inference regression on beta using `as _` #45480
jrmuizel
added a commit
to jrmuizel/zydis-rs
that referenced
this pull request
Oct 23, 2017
athre0z
added a commit
to zyantific/zydis-rs
that referenced
this pull request
Oct 24, 2017
arielb1
added
the
relnotes
label
Oct 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Given #45480, should this be tagged as (I skimmed the comments and commits and did not see that string anywhere, thus my question. Having it in the description can be useful for release notes...) |
This comment has been minimized.
This comment has been minimized.
|
I would be in favor of tagging this as However, it should be noted that type inference is specifically excluded from the backwards compatibility guarantees of Rust. See for example in the official FAQ, under "How does Rust language versioning work?":
That FAQ further says "For additional details, read the Rust blog post “Stability as a Deliverable.”, which also says the same, under "What are the stability caveats?":
So essentially, code relying on type inference is occasionally going to need some additional annotations. The reason is that type inference tries to do as much as it can, relying both on what impls exist and also on what impls don't exist. This is very useful, but has the downside that adding an impl may occasionally break working code, which is what happened here. |
This comment has been minimized.
This comment has been minimized.
|
Another important aspect of inference breakage is that it is (always?) possible to write code with more type annotations that works both in compiler with and without the change. |
Eh2406 commentedSep 3, 2017
Manually rebase of @Migi #41336