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

consistent naming for Rhs type parameter in libcore/ops #59190

Merged
merged 2 commits into from
Mar 23, 2019

Conversation

greg-kargin
Copy link
Contributor

Rename RHS type parameter occurrences RHS->Rhs to make it consistent throughout files and follow naming conventions.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aidanhs (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 14, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:29aa2f1f:start=1552598511995536208,finish=1552598512909902377,duration=914366169
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
[01:13:00] .................................................................................................... 1900/5467
[01:13:04] .................................................................................................... 2000/5467
[01:13:07] .................................................................i.................................. 2100/5467
[01:13:11] .................................................................................................... 2200/5467
[01:13:15] .....................................................F.............F................................ 2300/5467
[01:13:24] .................................................................................................... 2500/5467
[01:13:27] .................................................................................................... 2600/5467
[01:13:31] .................................................................................................... 2700/5467
[01:13:36] .................................................................................................... 2800/5467
---
[01:15:17] 
[01:15:17] ---- [ui] ui/issues/issue-21950.rs stdout ----
[01:15:17] diff of stderr:
[01:15:17] 
[01:15:17] - error[E0393]: the type parameter `RHS` must be explicitly specified
[01:15:17] + error[E0393]: the type parameter `Rhs` must be explicitly specified
[01:15:17] 3    |
[01:15:17] 4 LL |             &Add;
[01:15:17] 
[01:15:17] -    |              ^^^ missing reference to `RHS`
[01:15:17] -    |              ^^^ missing reference to `RHS`
[01:15:17] +    |              ^^^ missing reference to `Rhs`
[01:15:17] 6    |
[01:15:17] 7    = note: because of the default `Self` reference, type parameters must be specified on object types
[01:15:17] 
[01:15:17] 
[01:15:17] The actual stderr differed from the expected stderr.
[01:15:17] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21950/issue-21950.stderr
[01:15:17] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21950/issue-21950.stderr
[01:15:17] To update references, rerun the tests and pass the `--bless` flag
[01:15:17] To only update this specific test, also pass `--test-args issues/issue-21950.rs`
[01:15:17] error: 1 errors occurred comparing output.
[01:15:17] status: exit code: 1
[01:15:17] status: exit code: 1
[01:15:17] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-21950.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21950/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-21950/auxiliary" "-A" "unused"
[01:15:17] ------------------------------------------
[01:15:17] 
[01:15:17] ------------------------------------------
[01:15:17] stderr:
[01:15:17] stderr:
[01:15:17] ------------------------------------------
[01:15:17] {"message":"the type parameter `Rhs` must be explicitly specified","code":{"code":"E0393","explanation":"\nA type parameter which references `Self` in its default value was not specified.\nExample of erroneous code:\n\n```compile_fail,E0393\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A) {}\n// error: the type parameter `T` must be explicitly specified in an\n//        object type because its default value `Self` references the\n//        type `Self`\n```\n\nA trait object is defined over a single, fully-defined trait. With a regular\ndefault parameter, this parameter can just be substituted in. However, if the\ndefault parameter is `Self`, the trait changes for each concrete type; i.e.\n`i32` will be expected to implement `A<i32>`, `bool` will be expected to\nimplement `A<bool>`, etc... These types will not share an implementation of a\nfully-defined trait; instead they share implementations of a trait with\ndifferent parameters substituted in for each implementation. This is\nirreconcilable with what we need to make a trait object work, and is thus\ndisallowed. Making the trait concrete by explicitly specifying the value of the\ndefaulted parameter will fix this issue. Fixed example:\n\n```\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21950.rs","byte_start":91,"byte_end":94,"line_start":7,"line_end":7,"column_start":14,"column_end":17,"is_primary":true,"text":[{"text":"            &Add;","highlight_start":14,"highlight_end":17}],"label":"missing reference to `Rhs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"because of the default `Self` reference, type parameters must be specified on object types","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0393]: the type parameter `Rhs` must be explicitly specified\n  --> /checkout/src/test/ui/issues/issue-21950.rs:7:14\n   |\nLL |             &Add;\n   |              ^^^ missing reference to `Rhs`\n   |\n   = note: because of the default `Self` reference, type parameters must be specified on object types\n\n"}
[01:15:17] {"message":"the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified","code":{"code":"E0191","explanation":"\nTrait objects need to have all associated types specified. Erroneous code\nexample:\n\n```compile_fail,E0191\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait; // error: the value of the associated type `Bar` (from\n                  //        the trait `Trait`) must be specified\n```\n\nPlease verify you specified all associated types of the trait and that you\nused the right trait. Example:\n\n```\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait<Bar=i32>; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21950.rs","byte_start":91,"byte_end":94,"line_start":7,"line_end":7,"column_start":14,"column_end":17,"is_primary":true,"text":[{"text":"            &Add;","highlight_start":14,"highlight_end":17}],"label":"associated type `Output` must be specified","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified\n  --> /checkout/src/test/ui/issues/issue-21950.rs:7:14\n   |\nLL |             &Add;\n   |              ^^^ associated type `Output` must be specified\n\n"}
[01:15:17] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:15:17] {"message":"Some errors occurred: E0191, E0393.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0191, E0393.\n"}
[01:15:17] 
[01:15:17] ------------------------------------------
[01:15:17] 
[01:15:17] thread '[ui] ui/issues/issue-21950.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3325:9
[01:15:17] thread '[ui] ui/issues/issue-21950.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3325:9
[01:15:17] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:15:17] 
[01:15:17] ---- [ui] ui/issues/issue-22560.rs stdout ----
[01:15:17] diff of stderr:
[01:15:17] 
[01:15:17] - error[E0393]: the type parameter `RHS` must be explicitly specified
[01:15:17] + error[E0393]: the type parameter `Rhs` must be explicitly specified
[01:15:17] 3    |
[01:15:17] 4 LL | type Test = Add +
[01:15:17] 
[01:15:17] -    |             ^^^ missing reference to `RHS`
[01:15:17] -    |             ^^^ missing reference to `RHS`
[01:15:17] +    |             ^^^ missing reference to `Rhs`
[01:15:17] 6    |
[01:15:17] 7    = note: because of the default `Self` reference, type parameters must be specified on object types
[01:15:17] 
[01:15:17] 
[01:15:17] - error[E0393]: the type parameter `RHS` must be explicitly specified
[01:15:17] + error[E0393]: the type parameter `Rhs` must be explicitly specified
[01:15:17] 11    |
[01:15:17] 12 LL |             Sub;
[01:15:17] 
[01:15:17] -    |             ^^^ missing reference to `RHS`
[01:15:17] -    |             ^^^ missing reference to `RHS`
[01:15:17] +    |             ^^^ missing reference to `Rhs`
[01:15:17] 14    |
[01:15:17] 15    = note: because of the default `Self` reference, type parameters must be specified on object types
[01:15:17] 
[01:15:17] 
[01:15:17] The actual stderr differed from the expected stderr.
[01:15:17] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-22560/issue-22560.stderr
[01:15:17] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-22560/issue-22560.stderr
[01:15:17] To update references, rerun the tests and pass the `--bless` flag
[01:15:17] To only update this specific test, also pass `--test-args issues/issue-22560.rs`
[01:15:17] error: 1 errors occurred comparing output.
[01:15:17] status: exit code: 1
[01:15:17] status: exit code: 1
[01:15:17] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-22560.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-22560/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-22560/auxiliary" "-A" "unused"
[01:15:17] ------------------------------------------
[01:15:17] 
[01:15:17] ------------------------------------------
[01:15:17] stderr:
[01:15:17] stderr:
[01:15:17] ------------------------------------------
[01:15:17] {"message":"the type parameter `Rhs` must be explicitly specified","code":{"code":"E0393","explanation":"\nA type parameter which references `Self` in its default value was not specified.\nExample of erroneous code:\n\n```compile_fail,E0393\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A) {}\n// error: the type parameter `T` must be explicitly specified in an\n//        object type because its default value `Self` references the\n//        type `Self`\n```\n\nA trait object is defined over a single, fully-defined trait. With a regular\ndefault parameter, this parameter can just be substituted in. However, if the\ndefault parameter is `Self`, the trait changes for each concrete type; i.e.\n`i32` will be expected to implement `A<i32>`, `bool` will be expected to\nimplement `A<bool>`, etc... These types will not share an implementation of a\nfully-defined trait; instead they share implementations of a trait with\ndifferent parameters substituted in for each implementation. This is\nirreconcilable with what we need to make a trait object work, and is thus\ndisallowed. Making the trait concrete by explicitly specifying the value of the\ndefaulted parameter will fix this issue. Fixed example:\n\n```\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":69,"line_start":5,"line_end":5,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":16}],"label":"missing reference to `Rhs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"because of the default `Self` reference, type parameters must be specified on object types","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0393]: the type parameter `Rhs` must be explicitly specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:5:13\n   |\nLL | type Test = Add +\n   |             ^^^ missing reference to `Rhs`\n   |\n   = note: because of the default `Self` reference, type parameters must be specified on object types\n\n"}
[01:15:17] {"message":"the type parameter `Rhs` must be explicitly specified","code":{"code":"E0393","explanation":"\nA type parameter which references `Self` in its default value was not specified.\nExample of erroneous code:\n\n```compile_fail,E0393\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A) {}\n// error: the type parameter `T` must be explicitly specified in an\n//        object type because its default value `Self` references the\n//        type `Self`\n```\n\nA trait object is defined over a single, fully-defined trait. With a regular\ndefault parameter, this parameter can just be substituted in. However, if the\ndefault parameter is `Self`, the trait changes for each concrete type; i.e.\n`i32` will be expected to implement `A<i32>`, `bool` will be expected to\nimplement `A<bool>`, etc... These types will not share an implementation of a\nfully-defined trait; instead they share implementations of a trait with\ndifferent parameters substituted in for each implementation. This is\nirreconcilable with what we need to make a trait object work, and is thus\ndisallowed. Making the trait concrete by explicitly specifying the value of the\ndefaulted parameter will fix this issue. Fixed example:\n\n```\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":142,"byte_end":145,"line_start":8,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            Sub;","highlight_start":13,"highlight_end":16}],"label":"missing reference to `Rhs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"because of the default `Self` reference, type parameters must be specified on object types","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0393]: the type parameter `Rhs` must be explicitly specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:8:13\n   |\nLL |             Sub;\n   |             ^^^ missing reference to `Rhs`\n   |\n   = note: because of the default `Self` reference, type parameters must be specified on object types\n\n"}
[01:15:17] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":142,"byte_end":145,"line_start":8,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            Sub;","highlight_start":13,"highlight_end":16}],"label":"non-auto additional trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/issues/issue-22560.rs:8:13\n   |\nLL |             Sub;\n   |             ^^^ non-auto additional trait\n\n"}
[01:15:17] {"message":"the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified","code":{"code":"E0191","explanation":"\nTrait objects need to have all associated types specified. Erroneous code\nexample:\n\n```compile_fail,E0191\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait; // error: the value of the associated type `Bar` (from\n                  //        the trait `Trait`) must be specified\n```\n\nPlease verify you specified all associated types of the trait and that you\nused the right trait. Example:\n\n```\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait<Bar=i32>; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":145,"line_start":5,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":18},{"text":"            //~^ ERROR E0393","highlight_start":1,"highlight_end":29},{"text":"            //~| ERROR E0191","highlight_start":1,"highlight_end":29},{"text":"            Sub;","highlight_start":1,"highlight_end":16}],"label":"associated type `Output` must be specified","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:5:13\n   |\nLL |   type Test = Add +\n   |  _____________^\nLL | |             //~^ ERROR E0393\nLL | |             //~| ERROR E0191\nLL | |             Sub;\n   | |_______________^ associated type `Output` must be specified\n\n"}
[01:15:17] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[01:15:17] {"message":"Some errors occurred: E0191, E0225, E0393.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0191, E0225, E0393.\n"}
[01:15:17] 
[01:15:17] ------------------------------------------
[01:15:17] 
[01:15:17] thread '[ui] ui/issues/issue-22560.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3325:9
---
[01:15:17] 
[01:15:17] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:15:17] 
[01:15:17] 
[01:15:17] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:17] 
[01:15:17] 
[01:15:17] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:17] Build completed unsuccessfully in 0:04:20

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@estebank
Copy link
Contributor

You'll need to run ./x.py test src/test/ui --stage 1 --bless.

@sanxiyn
Copy link
Member

sanxiyn commented Mar 20, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Mar 20, 2019

📌 Commit 7f395d2 has been approved by sanxiyn

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2019
Centril added a commit to Centril/rust that referenced this pull request Mar 22, 2019
consistent naming for Rhs type parameter in libcore/ops

Rename RHS type parameter occurrences RHS->Rhs to make it consistent throughout files and follow naming conventions.
bors added a commit that referenced this pull request Mar 22, 2019
Rollup of 18 pull requests

Successful merges:

 - #59106 (Add peer_addr function to UdpSocket)
 - #59170 (Add const generics to rustdoc)
 - #59172 (Update and clean up several parts of CONTRIBUTING.md)
 - #59190 (consistent naming for Rhs type parameter in libcore/ops)
 - #59236 (Rename miri component to miri-preview)
 - #59266 (Do not complain about non-existing fields after parse recovery)
 - #59273 (some small HIR doc improvements)
 - #59291 (Make Option<ThreadId> no larger than ThreadId, with NonZeroU64)
 - #59297 (convert field/method confusion help to suggestions)
 - #59304 (Move some bench tests back from libtest)
 - #59309 (Add messages for different verbosity levels. Output copy actions.)
 - #59321 (Unify E0109, E0110 and E0111)
 - #59322 (Tweak incorrect escaped char diagnostic)
 - #59323 (use suggestions for "enum instead of variant" error)
 - #59327 (Add NAN test to docs)
 - #59329 (cleanup: Remove compile-fail-fulldeps directory again)
 - #59347 (Move one test from run-make-fulldeps to ui)
 - #59360 (Add tracking issue number for `seek_convenience`)

Failed merges:

r? @ghost
@bors bors merged commit 7f395d2 into rust-lang:master Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants