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

Improve compiler error message for wrong generic parameter order #72271

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

rakshith-ravi
Copy link
Contributor

  • Added optional "help" parameter that shows a help message on the compiler error if required.
  • Added a simple ordered parameter as a sample help.

@varkor will make more changes as required. Let me know if I'm heading in the right direction.

Fixes #68437

r? @varkor

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

The job x86_64-gnu-llvm-8 of your PR failed (pretty log, 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 63'
Agent machine name: 'fv-az578'
Current agent version: '2.168.2'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200430.2
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200430.2/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.2)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/e9bbeb9f-ae64-485f-8c32-9ace611c04fa.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72271/merge:refs/remotes/pull/72271/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
.......................................................i............................................ 1800/10169
.................................................................................................... 1900/10169
..........................................................................i..i...................... 2000/10169
.................................................................................................... 2100/10169
................................................................iiiii............................... 2200/10169
.................................................................................................... 2400/10169
.................................................................................................... 2500/10169
.................................................................................................... 2600/10169
.................................................................................................... 2700/10169
---
.................................................................................................... 5200/10169
.................................................................................................... 5300/10169
...........................i........................................................................ 5400/10169
....................i............................................................................... 5500/10169
............................ii.ii........i...i...................................................... 5600/10169
..............................................................................i..................... 5800/10169
.................................................................................................... 5900/10169
.........................ii.....................................i................................... 6000/10169
.................................................................................................... 6100/10169
.................................................................................................... 6100/10169
.................................................................................................... 6200/10169
......................................................................................ii...i..ii.... 6300/10169
.................................................................................................... 6500/10169
.................................................................................................... 6600/10169
.................................................................................................... 6700/10169
.................................................................................................... 6700/10169
...................i..ii............................................................................ 6800/10169
.................................................................................................... 7000/10169
.........................................................................i.......................... 7100/10169
.................................................................................................... 7200/10169
.................................................................................................... 7300/10169
---
.................................................................................................... 8100/10169
.................................................................................................... 8200/10169
...........................................................................................i........ 8300/10169
.................................................................................................... 8400/10169
..............................................iiiiiiiiiii.i......................................... 8500/10169
..................................................................................................i. 8600/10169
.................................................................................................... 8800/10169
.................................................................................................... 8900/10169
.................................................................................................... 9000/10169
...................................................................................F................ 9100/10169
---

13    |                                   ^
14    |
15    = note: type arguments must be provided before constant arguments
+    = help: Wrong parameter order found. A possible order is: T, N
17 error: aborting due to previous error; 1 warning emitted
18 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered/const-arg-type-arg-misordered.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args const-generics/const-arg-type-arg-misordered.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/const-generics/const-arg-type-arg-misordered/auxiliary"
------------------------------------------

------------------------------------------
stderr:
---

error[E0747]: constant provided when a type was expected
  --> /checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs:6:35
   |
LL | fn foo<const N: usize>() -> Array<N, ()> { //~ ERROR constant provided when a type was expected
   |
   = note: type arguments must be provided before constant arguments
   = note: type arguments must be provided before constant arguments
   = help: Wrong parameter order found. A possible order is: T, N
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0747`.

---

125    |                                                        ^^
126    |
127    = note: type arguments must be provided before lifetime arguments
+    = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
129 error[E0747]: lifetime provided when a type was expected
130   --> $DIR/suggest-move-types.rs:82:56

133    |                                                        ^^
133    |                                                        ^^
134    |
135    = note: type arguments must be provided before lifetime arguments
+    = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
137 error: aborting due to 12 previous errors
138 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types/suggest-move-types.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/suggest-move-types.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/suggest-move-types.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/suggestions/suggest-move-types/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:26:26
   |
LL | struct A<T, M: One<A=(), T>> {
   |                    ----  ^ generic argument
   |                    constraint
   |
help: move the constraint after the generic argument
   |
   |
LL | struct A<T, M: One<T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |                                     ----  ^  ^^ generic arguments
   |                                     constraint
   |
help: move the constraint after the generic arguments
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:40:46
   |
   |
LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
   |                            ----  ----  ----  ^  ^  ^ generic arguments
   |                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct B<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |                                                     ----  ----  ----  ^  ^  ^  ^^  ^^  ^^ generic arguments
   |                                                     constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:57:28
   |
   |
LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
   |                            ^  ----  ----  ----  ^  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct C<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:53
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |                                                     ^  ^^  ----  ----  ----  ^  ^^  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:74:28
   |
   |
LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
   |                            ^  ----  ----  ^  ----  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct D<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:53
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |                                                     ^  ^^  ----  ----  ^  ^^  ----  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: type provided when a lifetime was expected
error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: lifetime provided when a type was expected
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:56
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |
   = note: type arguments must be provided before lifetime arguments
   = note: type arguments must be provided before lifetime arguments
   = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:56
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |
   = note: type arguments must be provided before lifetime arguments
   = note: type arguments must be provided before lifetime arguments
   = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0747`.

---
test result: FAILED. 10106 passed; 2 failed; 61 ignored; 0 measured; 0 filtered out



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-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 1:00:06
== clock drift check ==
  local time: Sat May 16 15:48:39 UTC 2020
  network time: Sat, 16 May 2020 15:48:39 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72271/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3499) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@varkor
Copy link
Member

varkor commented May 16, 2020

You'll need to add a regression test in src/test/ui/<somewhere appropriate>. Once you've created the test, you can run x.py test <filename> --bless to create the test output.

@rakshith-ravi
Copy link
Contributor Author

Okay. But is my approach right though?

@varkor
Copy link
Member

varkor commented May 18, 2020

@rakshith-ravi: this looks like the right idea, yes! I'll leave some more detailed comments soon. I would just use one Vec instead of three, and instead use ParamKindOrd to sort the vector correctly.

@doctorn
Copy link
Contributor

doctorn commented May 22, 2020

#72441 will definitely interfere with this unfortunately

@rakshith-ravi
Copy link
Contributor Author

Sounds fun. I'm looking forward to it xD

Can you please help me understand what exactly that PR does?

@doctorn
Copy link
Contributor

doctorn commented May 22, 2020

@rakshith-ravi Yeah definitely! Are you active on the rust-lang Zulip?

@rakshith-ravi
Copy link
Contributor Author

Yup. You'll find me as Rakshith Ravi on it

@rakshith-ravi
Copy link
Contributor Author

rakshith-ravi commented May 24, 2020

@doctorn I've merged your branch into mine. So all merge conflicts are now resolved. You can merge this into master once #72441 gets merged.

@varkor I've added the changes you suggested as well. Sorting it out with a sort function call now, and removed those 3 Vecs

Still need to update the tests. Will get on that soon

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 of your PR failed (pretty log, 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az578'
Current agent version: '2.169.0'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200517.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200517.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.2)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/169ddc28-5c0b-4ce9-ae1e-95e56d8c1463.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72271/merge:refs/remotes/pull/72271/merge
---
 ---> cb2676f08729
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> df25ce111862
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 599b9ac96b27
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 091087e35a36
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
...........................................................................i........................ 1800/10222
.................................................................................................... 1900/10222
..............................................................................................i..i.. 2000/10222
.................................................................................................... 2100/10222
....................................................................................iiiii........... 2200/10222
.................................................................................................... 2400/10222
.................................................................................................... 2500/10222
.................................................................................................... 2600/10222
.................................................................................................... 2700/10222
---
...........i...............i........................................................................ 5200/10222
.................................................................................................... 5300/10222
..........................................................i......................................... 5400/10222
...................................................i................................................ 5500/10222
...............................................................ii.ii........i...i................... 5600/10222
.....i.............................................................................................. 5800/10222
.............i...................................................................................... 5900/10222
.................................................................ii................................. 6000/10222
....i............................................................................................... 6100/10222
....i............................................................................................... 6100/10222
.................................................................................................... 6200/10222
.................................................................................................... 6300/10222
..........................ii...i..ii...........i.................................................... 6400/10222
.................................................................................................... 6600/10222
.................................................................................................... 6700/10222
.................................................................................................... 6700/10222
...........................................................i..ii.................................... 6800/10222
.................................................................................................... 7000/10222
.................................................................................................... 7100/10222
.............i...................................................................................... 7200/10222
.................................................................................................... 7300/10222
---
.................................................................................................... 8100/10222
.................................................................................................... 8200/10222
.................................................................................................... 8300/10222
......................................i............................................................. 8400/10222
............................................................................................iiiiii.. 8500/10222
iiiiiii............................................................................................. 8600/10222
.................................................................................................... 8800/10222
.................................................................................................... 8900/10222
.................................................................................................... 9000/10222
.................................................................................................... 9100/10222
---

14    |                                   ^
15    |
16    = note: type arguments must be provided before constant arguments
+    = help: Wrong parameter order found. A possible order is: T, N
18 error: aborting due to previous error; 1 warning emitted
19 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered/const-arg-type-arg-misordered.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args const-generics/const-arg-type-arg-misordered.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/const-generics/const-arg-type-arg-misordered/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs:1:12
   |
LL | #![feature(const_generics)]
   |            ^^^^^^^^^^^^^^
   |
   = note: `#[warn(incomplete_features)]` on by default
   = note: see issue #44580 <***/issues/44580> for more information
error[E0747]: constant provided when a type was expected
  --> /checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs:6:35
   |
   |
LL | fn foo<const N: usize>() -> Array<N, ()> { //~ ERROR constant provided when a type was expected
   |
   = note: type arguments must be provided before constant arguments
   = note: type arguments must be provided before constant arguments
   = help: Wrong parameter order found. A possible order is: T, N
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0747`.

---

125    |                                                        ^^
126    |
127    = note: type arguments must be provided before lifetime arguments
+    = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
129 error[E0747]: lifetime provided when a type was expected
130   --> $DIR/suggest-move-types.rs:82:56

133    |                                                        ^^
133    |                                                        ^^
134    |
135    = note: type arguments must be provided before lifetime arguments
+    = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
137 error: aborting due to 12 previous errors
138 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types/suggest-move-types.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/suggest-move-types.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/suggest-move-types.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/suggestions/suggest-move-types/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:26:26
   |
LL | struct A<T, M: One<A=(), T>> {
   |                    ----  ^ generic argument
   |                    constraint
   |
help: move the constraint after the generic argument
   |
   |
LL | struct A<T, M: One<T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |                                     ----  ^  ^^ generic arguments
   |                                     constraint
   |
help: move the constraint after the generic arguments
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:40:46
   |
   |
LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
   |                            ----  ----  ----  ^  ^  ^ generic arguments
   |                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct B<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |                                                     ----  ----  ----  ^  ^  ^  ^^  ^^  ^^ generic arguments
   |                                                     constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:57:28
   |
   |
LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
   |                            ^  ----  ----  ----  ^  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct C<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:53
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |                                                     ^  ^^  ----  ----  ----  ^  ^^  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:74:28
   |
   |
LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
   |                            ^  ----  ----  ^  ----  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct D<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:53
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |                                                     ^  ^^  ----  ----  ^  ^^  ----  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: type provided when a lifetime was expected
error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: lifetime provided when a type was expected
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:56
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |
   = note: type arguments must be provided before lifetime arguments
   = note: type arguments must be provided before lifetime arguments
   = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:56
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |
   = note: type arguments must be provided before lifetime arguments
   = note: type arguments must be provided before lifetime arguments
   = help: Wrong parameter order found. A possible order is: 'a, 'b, 'c, Self, T, U, V
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0747`.

---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 0:59:24
Build completed unsuccessfully in 0:59:24
== clock drift check ==
  local time: Sun May 24 10:42:14 UTC 2020
  network time: Sun, 24 May 2020 10:42:14 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72271/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3888) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@rakshith-ravi
Copy link
Contributor Author

Okay, now that #72441 is approved, this can be merged along with it.
Also, @varkor I added the changes you requested as well

@rakshith-ravi rakshith-ravi changed the title [WIP] Improve compiler error message for wrong generic parameter order Improve compiler error message for wrong generic parameter order May 29, 2020
@varkor
Copy link
Member

varkor commented May 30, 2020

@rakshith-ravi: once #72441 is merged, could you rebase over it? That would make it easier to review changes (it's frustrating that GitHub doesn't support dependent pull requests).

@rakshith-ravi
Copy link
Contributor Author

Yeah, no worries. I already discussed it with @doctorn and I do plan to rebase it once #72441 gets merged

@doctorn
Copy link
Contributor

doctorn commented May 30, 2020

This is still missing some UI tests as well isn't it?

Ignore me

@@ -133,6 +134,7 @@ LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, '
| ^^
|
= note: type arguments must be provided before lifetime arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait hold on, shouldn't type arguments be provided after lifetime arguments?

Copy link
Contributor Author

@rakshith-ravi rakshith-ravi May 31, 2020

Choose a reason for hiding this comment

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

Huh. Yes, they should be. But that didn't come from my PR though, so I'm scared to touch it. 😆

I mean, I know exactly where this error is thrown, but I'm not sure I should be doing it lol

Copy link
Member

Choose a reason for hiding this comment

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

Woah, I'm shocked this wasn't caught before. Thanks for spotting this, @doctorn! I've opened up #72815 to make sure we don't lose track of this.

@bors
Copy link
Contributor

bors commented May 30, 2020

☔ The latest upstream changes (presumably #72778) made this pull request unmergeable. Please resolve the merge conflicts.

@rakshith-ravi
Copy link
Contributor Author

@varkor @doctorn done. Rebased it. 😄

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

This is looking good, thanks @rakshith-ravi! Just a few comments!

src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
src/librustc_typeck/astconv.rs Show resolved Hide resolved
@rakshith-ravi rakshith-ravi requested a review from varkor June 2, 2020 12:36
@bors
Copy link
Contributor

bors commented Jun 3, 2020

☔ The latest upstream changes (presumably #72935) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (pretty log, 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.
##[section]Starting: Linux x86_64-gnu-tools
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 4'
Agent machine name: 'fv-az578'
Current agent version: '2.169.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200517.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200517.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.3)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/ad3e743f-7825-447c-92e3-42d1efd3a665.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72271/merge:refs/remotes/pull/72271/merge
---
  local time: Wed Jun  3 05:09:05 UTC 2020
  network time: Wed, 03 Jun 2020 05:09:05 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72271/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3415) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

This is looking good! I just have a couple of comments about refactoring! After that, could you squash your commits down to one or two (e.g. by rebasing), and then I think we'll be good to go!

src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, 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.
##[section]Starting: Linux mingw-check
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 61'
Agent machine name: 'fv-az619'
Current agent version: '2.169.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200517.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200517.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.3)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/286dd2cd-d556-4c0f-b706-5d777ba22073.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72271/merge:refs/remotes/pull/72271/merge
---
 ---> 3adb0605cc65
Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
 ---> Using cache
 ---> 28dbc326cb7f
Step 7/7 : ENV SCRIPT python3 ../x.py test src/tools/expand-yaml-anchors &&            python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python3 ../x.py build --stage 0 src/tools/build-manifest &&            python3 ../x.py test --stage 0 src/tools/compiletest &&            python3 ../x.py test src/tools/tidy &&            python3 ../x.py doc --stage 0 src/libstd &&            /scripts/validate-toolstate.sh
 ---> 537a01811900
Successfully built 537a01811900
Successfully tagged rust-ci:latest
Built container sha256:537a018119009dc218456238dec90b5530050db1e2a1e166550c218003f6159d
---
    Checking rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
    Checking chalk-rust-ir v0.10.0
    Checking rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
    Checking rustc_hir v0.0.0 (/checkout/src/librustc_hir)
    Checking rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
    Checking chalk-solve v0.10.0
    Checking rustc_parse v0.0.0 (/checkout/src/librustc_parse)
    Checking rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
    Checking rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---

error[E0308]: mismatched types
   --> src/librustc_typeck/astconv.rs:677:65
    |
677 | ...                   params_present.contains(ParamKindOrd::Lifetime);
    |                                               |
    |                                               |
    |                                               expected `&rustc_ast::ast::ParamKindOrd`, found enum `rustc_ast::ast::ParamKindOrd`
    |                                               help: consider borrowing here: `&ParamKindOrd::Lifetime`
error[E0308]: mismatched types
   --> src/librustc_typeck/astconv.rs:679:65
    |
    |
679 | ...                   params_present.contains(ParamKindOrd::Type);
    |                                               |
    |                                               |
    |                                               expected `&rustc_ast::ast::ParamKindOrd`, found enum `rustc_ast::ast::ParamKindOrd`
    |                                               help: consider borrowing here: `&ParamKindOrd::Type`
error[E0308]: mismatched types
   --> src/librustc_typeck/astconv.rs:681:65
    |
    |
681 | ...                   params_present.contains(ParamKindOrd::Const);
    |                                               |
    |                                               |
    |                                               expected `&rustc_ast::ast::ParamKindOrd`, found enum `rustc_ast::ast::ParamKindOrd`
    |                                               help: consider borrowing here: `&ParamKindOrd::Const`
    Checking rustc_mir_build v0.0.0 (/checkout/src/librustc_mir_build)
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
error: could not compile `rustc_typeck`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--color" "always" "--features" " llvm" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:05:15
== clock drift check ==
  local time: Mon Jun  8 05:10:46 UTC 2020
  local time: Mon Jun  8 05:10:46 UTC 2020
  network time: Mon, 08 Jun 2020 05:10:46 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72271/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (3486) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@rakshith-ravi
Copy link
Contributor Author

Sorry about the spam, my laptop isn't good enough for me to build this repo, so I'm trying my best to figure out the code without building it.

@doctorn
Copy link
Contributor

doctorn commented Jun 8, 2020

You can use ./x.py check to check your types etc without building. It’s also incremental so once you’ve done it once it should be very quick for small changes.

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

This is looking good! Just a few more comments. (Sorry I didn't spot that you had updated the pull request earlier.)

Self::generic_arg_mismatch_err(tcx.sess, arg, kind.descr());
// We're going to iterate over the parameters to sort them out, and
// show that order to the user as a possible order for the parameters
let mut ordered_params = defs.params.clone();
Copy link
Member

Choose a reason for hiding this comment

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

Instead of two very similar match conditions, could we do something like the following?

let (ordered_params, mut params_present) = defs.params.clone().map(|param| (param, match param.kind {})).sort_by_key(|(_, ord)| ord);
params_present.dedup();

Copy link
Member

Choose a reason for hiding this comment

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

This was marked as resolved, but we're still matching on param.kind twice?

Copy link
Contributor Author

@rakshith-ravi rakshith-ravi Jun 16, 2020

Choose a reason for hiding this comment

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

Yeah the code mentioned there doesn't seem to compile. It seems to complain something about not being able to convert from map to tuple

Copy link
Member

Choose a reason for hiding this comment

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

I couldn't quite think off the top of my head what the types would be, so it may require a little adaption, but I think it would be good to only match on param.kind once if that results in cleaner code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, cool. I'll come up with something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @varkor. I'm getting this error:

the trait `std::hash::Hash` is not implemented for `rustc_middle::ty::GenericParamDef`

when trying to insert a GenericParamDef into a hashset.
Any idea how I can overcome this?

Copy link
Member

Choose a reason for hiding this comment

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

My idea was not to use a hash set any more: we're using a vector instead, but because it's sorted, once we dedup, the elements will be unique.

src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
src/librustc_typeck/astconv.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-8 of your PR failed (pretty log, 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.
##[section]Starting: Linux x86_64-gnu-llvm-8
##[section]Starting: Initialize job
Agent name: 'Azure Pipelines 49'
Agent machine name: 'fv-az578'
Current agent version: '2.170.1'
##[group]Operating System
16.04.6
LTS
LTS
##[endgroup]
##[group]Virtual Environment
Environment: ubuntu-16.04
Version: 20200604.1
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu16/20200604.1/images/linux/Ubuntu1604-README.md
##[endgroup]
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Download all required tasks.
Downloading task: Bash (3.163.3)
Checking job knob settings.
   Knob: AgentToolsDirectory = /opt/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
   Knob: AgentPerflog = /home/vsts/perflog Source: ${VSTS_AGENT_PERFLOG} 
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Configure Job Name
==============================================================================
---
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/1b30a742-b37b-4e9b-aa83-987e908d6f94.sh

##[section]Finishing: Disable git automatic line ending conversion
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
---
##[command]git remote add origin https://github.com/rust-lang/rust
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
##[command]git config --get-all http.proxy
##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/72271/merge:refs/remotes/pull/72271/merge
---
 ---> 29a56a071ad9
Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
 ---> Using cache
 ---> eb826cd6a4d7
Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
 ---> 9841042138f8
Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
 ---> Using cache
 ---> 00b49f7048de
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
   Compiling rustc_parse_format v0.0.0 (/checkout/src/librustc_parse_format)
   Compiling chalk-rust-ir v0.10.0
   Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
   Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
   Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
   Compiling chalk-solve v0.10.0
   Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
   Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
   Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
.................................................................................................... 1900/10319
.................................................................................................... 2000/10319
...............i..i................................................................................. 2100/10319
.................................................................................................... 2200/10319
.....iiiii.......................................................................................... 2300/10319
.................................................................................................... 2500/10319
.................................................................................................... 2600/10319
.................................................................................................... 2700/10319
.................................................................................................... 2800/10319
---
.................................................................................................... 6000/10319
.......ii.....................................i..................................................... 6100/10319
.................................................................................................... 6200/10319
.................................................................................................... 6300/10319
......................................................................ii...i..ii...........i........ 6400/10319
.................................................................................................... 6600/10319
.................................................................................................... 6700/10319
.................................................................................................... 6800/10319
.................................................................................................... 6800/10319
....i..ii........................................................................................... 6900/10319
.................................................................................................... 7100/10319
...........................................................i........................................ 7200/10319
.................................................................................................... 7300/10319
.................................................................................................... 7400/10319
---
.................................................................................................... 8200/10319
.................................................................................................... 8300/10319
.................................................................................................... 8400/10319
.i.................................................................................................. 8500/10319
.......................................................iiiiii.iiiiii.i.............................. 8600/10319
............i....................................................................................... 8800/10319
.................................................................................................... 8900/10319
.................................................................................................... 9000/10319
.................................................................................................... 9100/10319
---

14    |                                   ^
15    |
16    = note: type arguments must be provided before constant arguments
-    = help: reorder the arguments: types, then consts: `<T, N>`
+    = help: reorder the arguments: type, then const: `<T, N>`
19 error: aborting due to previous error; 1 warning emitted
20 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered/const-arg-type-arg-misordered.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args const-generics/const-arg-type-arg-misordered.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/const-arg-type-arg-misordered" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/const-generics/const-arg-type-arg-misordered/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
  --> /checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs:1:12
   |
LL | #![feature(const_generics)]
   |            ^^^^^^^^^^^^^^
   |
   = note: `#[warn(incomplete_features)]` on by default
   = note: see issue #44580 <***/issues/44580> for more information
error[E0747]: constant provided when a type was expected
  --> /checkout/src/test/ui/const-generics/const-arg-type-arg-misordered.rs:6:35
   |
   |
LL | fn foo<const N: usize>() -> Array<N, ()> { //~ ERROR constant provided when a type was expected
   |
   = note: type arguments must be provided before constant arguments
   = note: type arguments must be provided before constant arguments
   = help: reorder the arguments: type, then const: `<T, N>`
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0747`.

---

125    |                                                        ^^
126    |
127    = note: lifetime arguments must be provided before type arguments
-    = help: reorder the arguments: lifetimes, then types: `<'a, 'b, 'c, T, U, V>`
+    = help: reorder the arguments: lifetime, then type: `<'a, 'b, 'c, T, U, V>`
130 error[E0747]: lifetime provided when a type was expected
131   --> $DIR/suggest-move-types.rs:82:56

134    |                                                        ^^
134    |                                                        ^^
135    |
136    = note: lifetime arguments must be provided before type arguments
-    = help: reorder the arguments: lifetimes, then types: `<'a, 'b, 'c, T, U, V>`
+    = help: reorder the arguments: lifetime, then type: `<'a, 'b, 'c, T, U, V>`
139 error: aborting due to 12 previous errors
140 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types/suggest-move-types.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/suggest-move-types.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/suggest-move-types.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/suggest-move-types" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-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/suggestions/suggest-move-types/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:26:26
   |
LL | struct A<T, M: One<A=(), T>> {
   |                    ----  ^ generic argument
   |                    constraint
   |
help: move the constraint after the generic argument
   |
   |
LL | struct A<T, M: One<T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |                                     ----  ^  ^^ generic arguments
   |                                     constraint
   |
help: move the constraint after the generic arguments
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:40:46
   |
   |
LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
   |                            ----  ----  ----  ^  ^  ^ generic arguments
   |                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct B<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |                                                     ----  ----  ----  ^  ^  ^  ^^  ^^  ^^ generic arguments
   |                                                     constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:57:28
   |
   |
LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
   |                            ^  ----  ----  ----  ^  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct C<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:53
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |                                                     ^  ^^  ----  ----  ----  ^  ^^  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:74:28
   |
   |
LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
   |                            ^  ----  ----  ^  ----  ^ generic arguments
   |                               constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct D<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {

error: generic arguments must come before the first constraint
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:53
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |                                                     ^  ^^  ----  ----  ^  ^^  ----  ^  ^^ generic arguments
   |                                                            constraints
   |
help: move the constraints after the generic arguments
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {

error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:33:43
   |
   |
LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: type provided when a lifetime was expected
error[E0747]: type provided when a lifetime was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:48:71
   |
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
   |
   = note: lifetime arguments must be provided before type arguments

error[E0747]: lifetime provided when a type was expected
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:65:56
   |
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
   |
   = note: lifetime arguments must be provided before type arguments
   = note: lifetime arguments must be provided before type arguments
   = help: reorder the arguments: lifetime, then type: `<'a, 'b, 'c, T, U, V>`
error[E0747]: lifetime provided when a type was expected
  --> /checkout/src/test/ui/suggestions/suggest-move-types.rs:82:56
   |
   |
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
   |
   = note: lifetime arguments must be provided before type arguments
   = note: lifetime arguments must be provided before type arguments
   = help: reorder the arguments: lifetime, then type: `<'a, 'b, 'c, T, U, V>`
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0747`.

---
thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


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-8/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -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" "8.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
Build completed unsuccessfully in 0:59:20
Build completed unsuccessfully in 0:59:20
== clock drift check ==
  local time: Tue Jun 16 08:33:58 UTC 2020
  network time: Tue, 16 Jun 2020 08:33:58 GMT
== end clock drift check ==

##[error]Bash exited with code '1'.
##[section]Finishing: Run build
##[section]Starting: Checkout rust-lang/rust@refs/pull/72271/merge to s
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: rust-lang/rust (GitHub)
##[section]Finishing: Checkout rust-lang/rust@refs/pull/72271/merge to s
Cleaning up task key
Start cleaning up orphan processes.
Terminate orphan process: pid (4217) (python)
##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@varkor
Copy link
Member

varkor commented Jun 16, 2020

See if you can get something like this to work. In any case, I think it should be good after that, so could you squash your commits down to one or two commits to keep the history clean, and then I think it's ready to merge :)

})
.collect::<Vec<(ParamKindOrd, GenericParamDef)>>();
param_types_present.sort_by_key(|(ord, _)| *ord);
let mut param_types_present = param_types_present
Copy link
Member

Choose a reason for hiding this comment

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

Can you simply use unzip for this part?

@varkor
Copy link
Member

varkor commented Jun 17, 2020

One more comment; sorry for being so picky!

@rakshith-ravi
Copy link
Contributor Author

No worries. Sorry, I didn't know unzip existed 😅

@varkor
Copy link
Member

varkor commented Jun 19, 2020

@rakshith-ravi: great, thanks for your hard work! Could you squash your changes down to 1 or 2 commits? After that, it's good to be merged :)

@rakshith-ravi
Copy link
Contributor Author

Squashed 😄

@varkor
Copy link
Member

varkor commented Jun 21, 2020

Thanks @rakshith-ravi!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 21, 2020

📌 Commit 0624a5a has been approved by varkor

@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 Jun 21, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 21, 2020
Improve compiler error message for wrong generic parameter order

- Added optional "help" parameter that shows a help message on the compiler error if required.
- Added a simple ordered parameter as a sample help.

@varkor will make more changes as required. Let me know if I'm heading in the right direction.

Fixes rust-lang#68437

r? @varkor
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 21, 2020
Improve compiler error message for wrong generic parameter order

- Added optional "help" parameter that shows a help message on the compiler error if required.
- Added a simple ordered parameter as a sample help.

@varkor will make more changes as required. Let me know if I'm heading in the right direction.

Fixes rust-lang#68437

r? @varkor
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 22, 2020
Improve compiler error message for wrong generic parameter order

- Added optional "help" parameter that shows a help message on the compiler error if required.
- Added a simple ordered parameter as a sample help.

@varkor will make more changes as required. Let me know if I'm heading in the right direction.

Fixes rust-lang#68437

r? @varkor
This was referenced Jun 22, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2020
…arth

Rollup of 9 pull requests

Successful merges:

 - rust-lang#72271 (Improve compiler error message for wrong generic parameter order)
 - rust-lang#72493 ( move leak-check to during coherence, candidate eval)
 - rust-lang#73398 (A way forward for pointer equality in const eval)
 - rust-lang#73472 (Clean up E0689 explanation)
 - rust-lang#73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`)
 - rust-lang#73515 (Add second message for LiveDrop errors)
 - rust-lang#73567 (Clarify --extern documentation.)
 - rust-lang#73572 (Fix typos in doc comments)
 - rust-lang#73590 (bootstrap: no `config.toml` exists regression)

Failed merges:

r? @ghost
@bors bors merged commit 59e87c0 into rust-lang:master Jun 23, 2020
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.

Improve generic arg–param mismatch errors
6 participants