-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 14 pull requests #36153
Closed
Closed
Rollup of 14 pull requests #36153
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PR rust-lang#35695 for `Range` was approved, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`. add `fn main` wrappers to enable Rust Playground "Run" button
Fixes rust-lang#36112. Part of rust-lang#35233. r? @jonathandturner
These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary "xor" operator in Rust, so here it's expressed as (a || b) && !(a && b). r? @GuillaumeGomez improved documentation a la PR rust-lang#35993
…ng#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages.
…tln-remaining, r=GuillaumeGomez accumulate vector and assert for RangeFrom and RangeInclusive examples PR rust-lang#35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.
… r=GuillaumeGomez add evocative examples for `BitOr` and `BitXor` These are exactly equivalent to PR rust-lang#35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`. Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`. Let me know if you think one of those would be clearer. r? @GuillaumeGomez
…andturner Update compiler error E0076 to use new error format Fixes rust-lang#35221 part of rust-lang#35233 r? @jonathandturner
Add test for rust-lang#34053 Closes rust-lang#34053
Update E0393 to new error format Fixes rust-lang#35632. Part of rust-lang#35233. r? @jonathandturner and a wired thing is that if i add another label ```rust .span_label(span, &format!("missing reference to `{}`", def.name)) .span_label(span, &format!("because of the default `Self` reference, type parameters must be specified on object types")) ``` and add a new note in the test case like ```rust trait A<T=Self> {} fn together_we_will_rule_the_galaxy(son: &A) {} //~^ ERROR E0393 //~| NOTE missing reference to `T` //~| NOTE because of the default `Self` reference, type parameters must be specified on object types ``` it will complain that ``` running 1 test test [compile-fail] compile-fail/E0393.rs ... FAILED failures: ---- [compile-fail] compile-fail/E0393.rs stdout ---- error: /Users/zjh/Documents/rustspace/rust/src/test/compile-fail/E0393.rs:13: unexpected "error": '13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]' unexpected errors (from JSON output): [ Error { line_num: 13, kind: Some( Error ), msg: "13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]" } ] ``` it is a little bit confusing and through the blog post we can use `//~^` and `//~|` to support multiple notes, @jonathandturner am i missing something here?
rustbook chapters/sections should be an ordered list.
doc: make TcpListener example more simple
…thandturner Update E0520 to new error format Fixes rust-lang#36112. Part of rust-lang#35233. r? @jonathandturner
Update compiler error 0034 to use new format. Part of rust-lang#35233 Addresses rust-lang#35205 r? @jonathandturner
Add test for rust-lang#14875 You can check this out in the playground https://is.gd/oVKC2T . It will fail on stable, but pass on nightly as @nagisa suggested on the issue. Fixes rust-lang#14875
…ndturner Err codes r? @jonathandturner
update E0265 to new format Fixes rust-lang#35309 as part of rust-lang#35233. I've describe partially bonus achieve in rust-lang#35309 r? @jonathandturner
…thandturner Bonus format for E0194 Bonus fix for rust-lang#35280. Part of rust-lang#35233. Fixes rust-lang#36057. Adding expanded notes/context for what trait a parameter shadows as part of E0194 error messages. Errors for E0194 now look like this: ``` $> ./build/x86_64-apple-darwin/stage1/bin/rustc src/test/compile-fail/E0194.rs error[E0194]: type parameter `T` shadows another type parameter of the same name --> src/test/compile-fail/E0194.rs:13:26 | 11 | trait Foo<T> { //~ NOTE first `T` declared here | - first `T` declared here 12 | fn do_something(&self) -> T; 13 | fn do_something_else<T: Clone>(&self, bar: T); | ^ shadows another type parameter error: aborting due to previous error ``` r? @jonathandturner
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ p=1 |
📌 Commit e7c306d has been approved by |
⌛ Testing commit e7c306d with merge be629ba... |
💔 Test failed - auto-mac-64-opt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BitOr
andBitXor
#35926, Update compiler error E0076 to use new error format #36050, Add test for #34053 #36085, Add test for #24204 #36089, Update E0393 to new error format #36114, rustbook chapters/sections should be an ordered list. #36130, doc: make TcpListener example more simple #36134, Update E0520 to new error format #36135, Update compiler error 0034 to use new format. #36136, Add test for #14875 #36140, Err codes #36141, update E0265 to new format #36147, Bonus format for E0194 #36148