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

Correct the polymorphic extern fn error for const parameters #64360

Merged
merged 2 commits into from Sep 13, 2019

Conversation

@varkor
Copy link
Member

commented Sep 10, 2019

Before, any polymorphism on extern functions was assumed to be type polymorphism.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 10, 2019

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@cramertj

This comment has been minimized.

Copy link
Member

commented Sep 10, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

📌 Commit ef984ec has been approved by cramertj

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 10, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-09-10T17:47:47.1539907Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-10T17:47:47.9539758Z ##[command]git config gc.auto 0
2019-09-10T17:47:47.9550479Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-10T17:47:47.9555394Z ##[command]git config --get-all http.proxy
2019-09-10T17:47:47.9560836Z ##[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/64360/merge:refs/remotes/pull/64360/merge
---
2019-09-10T18:54:39.1701546Z .................................................................................................... 1500/9007
2019-09-10T18:54:45.5612829Z .................................................................................................... 1600/9007
2019-09-10T18:54:59.1395175Z ........................................................i...............i........................... 1700/9007
2019-09-10T18:55:07.4794298Z .................................................................................................... 1800/9007
2019-09-10T18:55:23.3063626Z ...............................................iiiii................................................ 1900/9007
2019-09-10T18:55:35.1349692Z ....................................F............................................................... 2100/9007
2019-09-10T18:55:37.8584469Z .................................................................................................... 2200/9007
2019-09-10T18:55:41.9643281Z .................................................................................................... 2300/9007
2019-09-10T18:55:50.3291853Z .................................................................................................... 2400/9007
---
2019-09-10T18:59:01.0905679Z ...................................i..............i................................................. 4700/9007
2019-09-10T18:59:13.4950386Z .................................................................................................... 4800/9007
2019-09-10T18:59:20.9061898Z .................................................................................................... 4900/9007
2019-09-10T18:59:32.3924046Z .................................................................................................... 5000/9007
2019-09-10T18:59:38.9105046Z .................ii.ii.............................................................................. 5100/9007
2019-09-10T18:59:50.3754747Z .................................................................................................... 5300/9007
2019-09-10T19:00:01.2214441Z ................................................................................i................... 5400/9007
2019-09-10T19:00:09.5667004Z .................................................................................................... 5500/9007
2019-09-10T19:00:16.0167360Z .................................................................................................... 5600/9007
2019-09-10T19:00:16.0167360Z .................................................................................................... 5600/9007
2019-09-10T19:00:27.7405057Z ..........................................................................ii...i..ii...........i.... 5700/9007
2019-09-10T19:00:53.7630681Z .................................................................................................... 5900/9007
2019-09-10T19:01:03.9124823Z .................................................................................................... 6000/9007
2019-09-10T19:01:03.9124823Z .................................................................................................... 6000/9007
2019-09-10T19:01:09.5452768Z ............................................................................i..ii................... 6100/9007
2019-09-10T19:01:41.5870377Z .................................................................................................... 6300/9007
2019-09-10T19:01:43.8916646Z ...................................i................................................................ 6400/9007
2019-09-10T19:01:46.2143576Z .................................................................................................... 6500/9007
2019-09-10T19:01:49.0112772Z .......i............................................................................................ 6600/9007
---
2019-09-10T19:06:12.5469377Z 
2019-09-10T19:06:12.5472859Z ---- [ui] ui/error-codes/E0044.rs stdout ----
2019-09-10T19:06:12.5472951Z diff of stderr:
2019-09-10T19:06:12.5472983Z 
2019-09-10T19:06:12.5473215Z 4 LL |     fn sqrt<T>(f: T) -> T;
2019-09-10T19:06:12.5473530Z 6    |
2019-09-10T19:06:12.5473530Z 6    |
2019-09-10T19:06:12.5473813Z -    = help: use specialization instead of type parameters by replacing them with concrete types like `u32`
2019-09-10T19:06:12.5473905Z +    = help: use specialization instead of type parameters by replacing them with concrete typelike `u32`
2019-09-10T19:06:12.5474032Z 9 error: aborting due to previous error
2019-09-10T19:06:12.5474075Z 10 
2019-09-10T19:06:12.5474122Z 
2019-09-10T19:06:12.5474148Z 
2019-09-10T19:06:12.5474148Z 
2019-09-10T19:06:12.5474195Z The actual stderr differed from the expected stderr.
2019-09-10T19:06:12.5474492Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0044/E0044.stderr
2019-09-10T19:06:12.5474770Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T19:06:12.5475029Z To only update this specific test, also pass `--test-args error-codes/E0044.rs`
2019-09-10T19:06:12.5475126Z error: 1 errors occurred comparing output.
2019-09-10T19:06:12.5475172Z status: exit code: 1
2019-09-10T19:06:12.5475172Z status: exit code: 1
2019-09-10T19:06:12.5475908Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0044.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0044" "-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/error-codes/E0044/auxiliary" "-A" "unused"
2019-09-10T19:06:12.5476254Z ------------------------------------------
2019-09-10T19:06:12.5476291Z 
2019-09-10T19:06:12.5476524Z ------------------------------------------
2019-09-10T19:06:12.5476572Z stderr:
2019-09-10T19:06:12.5476572Z stderr:
2019-09-10T19:06:12.5477082Z ------------------------------------------
2019-09-10T19:06:12.5477163Z error[E0044]: foreign items may not have type parameters
2019-09-10T19:06:12.5477401Z   --> /checkout/src/test/ui/error-codes/E0044.rs:2:5
2019-09-10T19:06:12.5477457Z    |
2019-09-10T19:06:12.5477710Z LL |     fn sqrt<T>(f: T) -> T;
2019-09-10T19:06:12.5478271Z    |
2019-09-10T19:06:12.5478271Z    |
2019-09-10T19:06:12.5478346Z    = help: use specialization instead of type parameters by replacing them with concrete typelike `u32`
2019-09-10T19:06:12.5478437Z error: aborting due to previous error
2019-09-10T19:06:12.5478468Z 
2019-09-10T19:06:12.5478809Z For more information about this error, try `rustc --explain E0044`.
2019-09-10T19:06:12.5478996Z 
---
2019-09-10T19:06:12.5479668Z 
2019-09-10T19:06:12.5479728Z 4 LL |     fn foo<T>();
2019-09-10T19:06:12.5479977Z 5    |     ^^^^^^^^^^^^ can't have type parameters
2019-09-10T19:06:12.5480028Z 6    |
2019-09-10T19:06:12.5480353Z -    = help: use specialization instead of type parameters by replacing them with concrete types like `u32`
2019-09-10T19:06:12.5480420Z +    = help: use specialization instead of type parameters by replacing them with concrete typelike `u32`
2019-09-10T19:06:12.5480516Z 9 error: aborting due to previous error
2019-09-10T19:06:12.5480577Z 10 
2019-09-10T19:06:12.5480606Z 
2019-09-10T19:06:12.5480634Z 
2019-09-10T19:06:12.5480634Z 
2019-09-10T19:06:12.5480682Z The actual stderr differed from the expected stderr.
2019-09-10T19:06:12.5481031Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic/generic-extern/generic-extern.stderr
2019-09-10T19:06:12.5481299Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T19:06:12.5481581Z To only update this specific test, also pass `--test-args generic/generic-extern.rs`
2019-09-10T19:06:12.5481684Z error: 1 errors occurred comparing output.
2019-09-10T19:06:12.5481731Z status: exit code: 1
2019-09-10T19:06:12.5481731Z status: exit code: 1
2019-09-10T19:06:12.5482501Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/generic/generic-extern.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic/generic-extern" "-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/generic/generic-extern/auxiliary" "-A" "unused"
2019-09-10T19:06:12.5482858Z ------------------------------------------
2019-09-10T19:06:12.5482897Z 
2019-09-10T19:06:12.5483136Z ------------------------------------------
2019-09-10T19:06:12.5483206Z stderr:
2019-09-10T19:06:12.5483206Z stderr:
2019-09-10T19:06:12.5483440Z ------------------------------------------
2019-09-10T19:06:12.5483497Z error[E0044]: foreign items may not have type parameters
2019-09-10T19:06:12.5483757Z   --> /checkout/src/test/ui/generic/generic-extern.rs:2:5
2019-09-10T19:06:12.5483829Z    |
2019-09-10T19:06:12.5483881Z LL |     fn foo<T>(); //~ ERROR foreign items may not have type parameters
2019-09-10T19:06:12.5484201Z    |
2019-09-10T19:06:12.5484201Z    |
2019-09-10T19:06:12.5484254Z    = help: use specialization instead of type parameters by replacing them with concrete typelike `u32`
2019-09-10T19:06:12.5484369Z error: aborting due to previous error
2019-09-10T19:06:12.5484400Z 
2019-09-10T19:06:12.5484662Z For more information about this error, try `rustc --explain E0044`.
2019-09-10T19:06:12.5484699Z 
---
2019-09-10T19:06:12.5500374Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-09-10T19:06:12.5500502Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-09-10T19:06:12.5514422Z 
2019-09-10T19:06:12.5514540Z 
2019-09-10T19:06:12.5516986Z 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 -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" "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"
2019-09-10T19:06:12.5517275Z 
2019-09-10T19:06:12.5517306Z 
2019-09-10T19:06:12.5523088Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-10T19:06:12.5523167Z Build completed unsuccessfully in 1:10:44
2019-09-10T19:06:12.5523167Z Build completed unsuccessfully in 1:10:44
2019-09-10T19:06:12.5575550Z == clock drift check ==
2019-09-10T19:06:12.5591375Z   local time: Tue Sep 10 19:06:12 UTC 2019
2019-09-10T19:06:12.6457982Z   network time: Tue, 10 Sep 2019 19:06:12 GMT
2019-09-10T19:06:12.6459443Z == end clock drift check ==
2019-09-10T19:06:13.4989379Z ##[error]Bash exited with code '1'.
2019-09-10T19:06:13.5028220Z ##[section]Starting: Checkout
2019-09-10T19:06:13.5030174Z ==============================================================================
2019-09-10T19:06:13.5030228Z Task         : Get sources
2019-09-10T19:06:13.5030292Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@varkor varkor force-pushed the varkor:foreign-items-diagnostic-const-generics branch from ef984ec to c8c82bc Sep 10, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Sep 10, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-09-10T19:46:01.2337871Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-10T19:46:01.2503261Z ##[command]git config gc.auto 0
2019-09-10T19:46:01.2573446Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-10T19:46:01.2630307Z ##[command]git config --get-all http.proxy
2019-09-10T19:46:01.2744736Z ##[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/64360/merge:refs/remotes/pull/64360/merge
---
2019-09-10T20:45:44.3871192Z .................................................................................................... 1500/9007
2019-09-10T20:45:49.9960632Z .................................................................................................... 1600/9007
2019-09-10T20:46:02.3203450Z ........................................................i...............i........................... 1700/9007
2019-09-10T20:46:09.8249747Z .................................................................................................... 1800/9007
2019-09-10T20:46:23.9868974Z ...............................................iiiii................................................ 1900/9007
2019-09-10T20:46:34.5603378Z .................................................................................................... 2100/9007
2019-09-10T20:46:36.8940017Z .................................................................................................... 2200/9007
2019-09-10T20:46:40.4148059Z .................................................................................................... 2300/9007
2019-09-10T20:46:47.9337268Z .................................................................................................... 2400/9007
---
2019-09-10T20:49:39.3922156Z ..................................i...............i................................................. 4700/9007
2019-09-10T20:49:50.4564564Z .................................................................................................... 4800/9007
2019-09-10T20:49:56.6611604Z .................................................................................................... 4900/9007
2019-09-10T20:50:06.4737287Z .................................................................................................... 5000/9007
2019-09-10T20:50:12.0797411Z .................ii.ii.............................................................................. 5100/9007
2019-09-10T20:50:21.3202471Z .................................................................................................... 5300/9007
2019-09-10T20:50:30.2306074Z ................................................................................i................... 5400/9007
2019-09-10T20:50:37.0826531Z .................................................................................................... 5500/9007
2019-09-10T20:50:42.3103897Z .................................................................................................... 5600/9007
2019-09-10T20:50:42.3103897Z .................................................................................................... 5600/9007
2019-09-10T20:50:51.5950384Z ..........................................................................ii...i..ii...........i.... 5700/9007
2019-09-10T20:51:13.4838028Z .................................................................................................... 5900/9007
2019-09-10T20:51:21.8273717Z .................................................................................................... 6000/9007
2019-09-10T20:51:21.8273717Z .................................................................................................... 6000/9007
2019-09-10T20:51:26.3685753Z ............................................................................i..ii................... 6100/9007
2019-09-10T20:51:52.6747279Z .................................................................................................... 6300/9007
2019-09-10T20:51:54.4536529Z ...................................i................................................................ 6400/9007
2019-09-10T20:51:56.3139244Z .................................................................................................... 6500/9007
2019-09-10T20:51:58.4687472Z .......i............................................................................................ 6600/9007
---
2019-09-10T20:55:32.0409004Z 
2019-09-10T20:55:32.0410120Z ---- [ui] ui/const-generics/foreign-item-const-parameter.rs stdout ----
2019-09-10T20:55:32.0410220Z diff of stderr:
2019-09-10T20:55:32.0410256Z 
2019-09-10T20:55:32.0410303Z 12 LL |     fn foo<const X: usize>();
2019-09-10T20:55:32.0410659Z 14    |
2019-09-10T20:55:32.0410928Z -    = help: use specialization instead of const parameters by replacing them with concrete const
2019-09-10T20:55:32.0410991Z +    = help: use specialization instead of const parameters by replacing them with concrete consts
2019-09-10T20:55:32.0411061Z 16 
2019-09-10T20:55:32.0411061Z 16 
2019-09-10T20:55:32.0411157Z 17 error[E0044]: foreign items may not have type or const parameters
2019-09-10T20:55:32.0411402Z 18   --> $DIR/foreign-item-const-parameter.rs:7:5
2019-09-10T20:55:32.0411455Z 
2019-09-10T20:55:32.0411501Z 20 LL |     fn bar<T, const X: usize>(_: T);
2019-09-10T20:55:32.0411824Z 22    |
2019-09-10T20:55:32.0412105Z -    = help: use specialization instead of type or const parameters by replacing them with concrete type or const
2019-09-10T20:55:32.0412172Z +    = help: use specialization instead of type or const parameters by replacing them with concrete types or consts
2019-09-10T20:55:32.0412240Z 24 
2019-09-10T20:55:32.0412240Z 24 
2019-09-10T20:55:32.0412286Z 25 error: aborting due to 2 previous errors
2019-09-10T20:55:32.0412328Z 26 
2019-09-10T20:55:32.0412355Z 
2019-09-10T20:55:32.0412381Z 
2019-09-10T20:55:32.0412446Z The actual stderr differed from the expected stderr.
2019-09-10T20:55:32.0412802Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/foreign-item-const-parameter/foreign-item-const-parameter.stderr
2019-09-10T20:55:32.0413075Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T20:55:32.0413815Z To only update this specific test, also pass `--test-args const-generics/foreign-item-const-parameter.rs`
2019-09-10T20:55:32.0413875Z error: 1 errors occurred comparing output.
2019-09-10T20:55:32.0413925Z status: exit code: 1
2019-09-10T20:55:32.0413925Z status: exit code: 1
2019-09-10T20:55:32.0414499Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/foreign-item-const-parameter" "-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/foreign-item-const-parameter/auxiliary" "-A" "unused"
2019-09-10T20:55:32.0414754Z ------------------------------------------
2019-09-10T20:55:32.0414778Z 
2019-09-10T20:55:32.0414950Z ------------------------------------------
2019-09-10T20:55:32.0414984Z stderr:
---
2019-09-10T20:55:32.0415608Z 
2019-09-10T20:55:32.0415913Z error[E0044]: foreign items may not have const parameters
2019-09-10T20:55:32.0416151Z   --> /checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs:5:5
2019-09-10T20:55:32.0416207Z    |
2019-09-10T20:55:32.0416244Z LL |     fn foo<const X: usize>(); //~ ERROR foreign items may not have const parameters
2019-09-10T20:55:32.0416470Z    |
2019-09-10T20:55:32.0416507Z    = help: use specialization instead of const parameters by replacing them with concrete consts
2019-09-10T20:55:32.0416533Z 
2019-09-10T20:55:32.0416567Z error[E0044]: foreign items may not have type or const parameters
2019-09-10T20:55:32.0416567Z error[E0044]: foreign items may not have type or const parameters
2019-09-10T20:55:32.0416770Z   --> /checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs:7:5
2019-09-10T20:55:32.0416806Z    |
2019-09-10T20:55:32.0416844Z LL |     fn bar<T, const X: usize>(_: T); //~ ERROR foreign items may not have type or const parameters
2019-09-10T20:55:32.0417104Z    |
2019-09-10T20:55:32.0417143Z    = help: use specialization instead of type or const parameters by replacing them with concrete types or consts
2019-09-10T20:55:32.0417189Z 
2019-09-10T20:55:32.0417224Z error: aborting due to 2 previous errors
---
2019-09-10T20:55:32.0438980Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-09-10T20:55:32.0439475Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-09-10T20:55:32.0453499Z 
2019-09-10T20:55:32.0454173Z 
2019-09-10T20:55:32.0464717Z 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 -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" "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"
2019-09-10T20:55:32.0464965Z 
2019-09-10T20:55:32.0465007Z 
2019-09-10T20:55:32.0470227Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-10T20:55:32.0470472Z Build completed unsuccessfully in 1:02:26
2019-09-10T20:55:32.0470472Z Build completed unsuccessfully in 1:02:26
2019-09-10T20:55:32.0524845Z == clock drift check ==
2019-09-10T20:55:32.0543165Z   local time: Tue Sep 10 20:55:32 UTC 2019
2019-09-10T20:55:32.2025814Z   network time: Tue, 10 Sep 2019 20:55:32 GMT
2019-09-10T20:55:32.2028178Z == end clock drift check ==
2019-09-10T20:55:33.0470589Z ##[error]Bash exited with code '1'.
2019-09-10T20:55:33.0510036Z ##[section]Starting: Checkout
2019-09-10T20:55:33.0511947Z ==============================================================================
2019-09-10T20:55:33.0512004Z Task         : Get sources
2019-09-10T20:55:33.0512071Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved
src/librustc_typeck/check/mod.rs Outdated Show resolved Hide resolved

@varkor varkor force-pushed the varkor:foreign-items-diagnostic-const-generics branch from c8c82bc to 14e6947 Sep 10, 2019

@varkor varkor force-pushed the varkor:foreign-items-diagnostic-const-generics branch 2 times, most recently from c6de6f8 to f82500b Sep 10, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Sep 10, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-09-10T21:55:00.8177242Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-09-10T21:55:00.8356945Z ##[command]git config gc.auto 0
2019-09-10T21:55:00.8436220Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-09-10T21:55:00.8483804Z ##[command]git config --get-all http.proxy
2019-09-10T21:55:00.8621741Z ##[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/64360/merge:refs/remotes/pull/64360/merge
---
2019-09-10T22:58:10.3023963Z .................................................................................................... 1500/9009
2019-09-10T22:58:16.4525395Z .................................................................................................... 1600/9009
2019-09-10T22:58:29.3711023Z ..........................................................i...............i......................... 1700/9009
2019-09-10T22:58:37.3959944Z .................................................................................................... 1800/9009
2019-09-10T22:58:52.3613315Z .................................................iiiii.............................................. 1900/9009
2019-09-10T22:59:03.9349382Z .......................................F............................................................ 2100/9009
2019-09-10T22:59:06.6550979Z .................................................................................................... 2200/9009
2019-09-10T22:59:10.3976993Z .................................................................................................... 2300/9009
2019-09-10T22:59:18.7994653Z .................................................................................................... 2400/9009
---
2019-09-10T23:02:22.9364567Z ....................................i...............i............................................... 4700/9009
2019-09-10T23:02:34.5522528Z .................................................................................................... 4800/9009
2019-09-10T23:02:41.3692154Z .................................................................................................... 4900/9009
2019-09-10T23:02:52.4602098Z .................................................................................................... 5000/9009
2019-09-10T23:02:58.9370770Z ...................ii.ii............................................................................ 5100/9009
2019-09-10T23:03:09.9364336Z .................................................................................................... 5300/9009
2019-09-10T23:03:20.3584987Z ..................................................................................i................. 5400/9009
2019-09-10T23:03:28.5950236Z .................................................................................................... 5500/9009
2019-09-10T23:03:34.4838620Z .................................................................................................... 5600/9009
2019-09-10T23:03:34.4838620Z .................................................................................................... 5600/9009
2019-09-10T23:03:45.2544923Z ............................................................................ii...i..ii...........i.. 5700/9009
2019-09-10T23:04:11.5973477Z .................................................................................................... 5900/9009
2019-09-10T23:04:21.7255395Z .................................................................................................... 6000/9009
2019-09-10T23:04:21.7255395Z .................................................................................................... 6000/9009
2019-09-10T23:04:31.1086365Z ..............................................................................i..ii................. 6100/9009
2019-09-10T23:05:01.5348056Z .................................................................................................... 6300/9009
2019-09-10T23:05:03.9025091Z .....................................i.............................................................. 6400/9009
2019-09-10T23:05:06.2218242Z .................................................................................................... 6500/9009
2019-09-10T23:05:08.9799050Z .........i.......................................................................................... 6600/9009
---
2019-09-10T23:09:20.1889108Z 
2019-09-10T23:09:20.1890050Z ---- [ui] ui/const-generics/foreign-item-const-parameter.rs stdout ----
2019-09-10T23:09:20.1890393Z diff of stderr:
2019-09-10T23:09:20.1890644Z 
2019-09-10T23:09:20.1890872Z 12 LL |     fn foo<const X: usize>();
2019-09-10T23:09:20.1892726Z 14    |
2019-09-10T23:09:20.1893339Z -    = help: replace the const parameters with concrete consts
2019-09-10T23:09:20.1893673Z +    = help: replace the const parameters with concreteconsts
2019-09-10T23:09:20.1893934Z 16 
2019-09-10T23:09:20.1893934Z 16 
2019-09-10T23:09:20.1894158Z 17 error[E0044]: foreign items may not have type or const parameters
2019-09-10T23:09:20.1894646Z 18   --> $DIR/foreign-item-const-parameter.rs:7:5
2019-09-10T23:09:20.1894947Z 
2019-09-10T23:09:20.1895410Z 20 LL |     fn bar<T, const X: usize>(_: T);
2019-09-10T23:09:20.1896399Z 22    |
2019-09-10T23:09:20.1896912Z -    = help: replace the type or const parameters with concrete types or consts
2019-09-10T23:09:20.1897220Z +    = help: replace the type or const parameters with concretetypes or consts
2019-09-10T23:09:20.1897475Z 24 
2019-09-10T23:09:20.1897475Z 24 
2019-09-10T23:09:20.1898077Z 25 error: aborting due to 2 previous errors
2019-09-10T23:09:20.1898440Z 26 
2019-09-10T23:09:20.1898634Z 
2019-09-10T23:09:20.1898819Z 
2019-09-10T23:09:20.1899143Z The actual stderr differed from the expected stderr.
2019-09-10T23:09:20.1899768Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/foreign-item-const-parameter/foreign-item-const-parameter.stderr
2019-09-10T23:09:20.1900714Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T23:09:20.1901356Z To only update this specific test, also pass `--test-args const-generics/foreign-item-const-parameter.rs`
2019-09-10T23:09:20.1902267Z error: 1 errors occurred comparing output.
2019-09-10T23:09:20.1902516Z status: exit code: 1
2019-09-10T23:09:20.1902516Z status: exit code: 1
2019-09-10T23:09:20.1903612Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-generics/foreign-item-const-parameter" "-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/foreign-item-const-parameter/auxiliary" "-A" "unused"
2019-09-10T23:09:20.1905783Z ------------------------------------------
2019-09-10T23:09:20.1905990Z 
2019-09-10T23:09:20.1906522Z ------------------------------------------
2019-09-10T23:09:20.1906712Z stderr:
---
2019-09-10T23:09:20.1908765Z 
2019-09-10T23:09:20.1908904Z error[E0044]: foreign items may not have const parameters
2019-09-10T23:09:20.1909524Z   --> /checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs:5:5
2019-09-10T23:09:20.1909833Z    |
2019-09-10T23:09:20.1910210Z LL |     fn foo<const X: usize>(); //~ ERROR foreign items may not have const parameters
2019-09-10T23:09:20.1910826Z    |
2019-09-10T23:09:20.1910972Z    = help: replace the const parameters with concreteconsts
2019-09-10T23:09:20.1912019Z 
2019-09-10T23:09:20.1912202Z error[E0044]: foreign items may not have type or const parameters
2019-09-10T23:09:20.1912202Z error[E0044]: foreign items may not have type or const parameters
2019-09-10T23:09:20.1912703Z   --> /checkout/src/test/ui/const-generics/foreign-item-const-parameter.rs:7:5
2019-09-10T23:09:20.1912940Z    |
2019-09-10T23:09:20.1913089Z LL |     fn bar<T, const X: usize>(_: T); //~ ERROR foreign items may not have type or const parameters
2019-09-10T23:09:20.1913725Z    |
2019-09-10T23:09:20.1913872Z    = help: replace the type or const parameters with concretetypes or consts
2019-09-10T23:09:20.1913999Z 
2019-09-10T23:09:20.1914153Z error: aborting due to 2 previous errors
---
2019-09-10T23:09:20.1915821Z 
2019-09-10T23:09:20.1916165Z ---- [ui] ui/error-codes/E0044.rs stdout ----
2019-09-10T23:09:20.1916338Z diff of stderr:
2019-09-10T23:09:20.1916443Z 
2019-09-10T23:09:20.1916775Z 4 LL |     fn sqrt<T>(f: T) -> T;
2019-09-10T23:09:20.1917514Z 6    |
2019-09-10T23:09:20.1917874Z -    = help: replace the type parameters with concrete types like `u32`
2019-09-10T23:09:20.1918054Z +    = help: replace the type parameters with concretetypes like `u32`
2019-09-10T23:09:20.1918177Z 8 
2019-09-10T23:09:20.1918177Z 8 
2019-09-10T23:09:20.1918366Z 9 error: aborting due to previous error
2019-09-10T23:09:20.1918502Z 10 
2019-09-10T23:09:20.1918603Z 
2019-09-10T23:09:20.1918705Z 
2019-09-10T23:09:20.1918858Z The actual stderr differed from the expected stderr.
2019-09-10T23:09:20.1919268Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0044/E0044.stderr
2019-09-10T23:09:20.1919668Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T23:09:20.1920098Z To only update this specific test, also pass `--test-args error-codes/E0044.rs`
2019-09-10T23:09:20.1920412Z error: 1 errors occurred comparing output.
2019-09-10T23:09:20.1920561Z status: exit code: 1
2019-09-10T23:09:20.1920561Z status: exit code: 1
2019-09-10T23:09:20.1922224Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0044.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0044" "-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/error-codes/E0044/auxiliary" "-A" "unused"
2019-09-10T23:09:20.1923008Z ------------------------------------------
2019-09-10T23:09:20.1923211Z 
2019-09-10T23:09:20.1923780Z ------------------------------------------
2019-09-10T23:09:20.1924430Z stderr:
2019-09-10T23:09:20.1924430Z stderr:
2019-09-10T23:09:20.1924941Z ------------------------------------------
2019-09-10T23:09:20.1925145Z error[E0044]: foreign items may not have type parameters
2019-09-10T23:09:20.1925667Z   --> /checkout/src/test/ui/error-codes/E0044.rs:2:5
2019-09-10T23:09:20.1925843Z    |
2019-09-10T23:09:20.1926292Z LL |     fn sqrt<T>(f: T) -> T;
2019-09-10T23:09:20.1929324Z    |
2019-09-10T23:09:20.1929634Z    = help: replace the type parameters with concretetypes like `u32`
2019-09-10T23:09:20.1929776Z 
2019-09-10T23:09:20.1930013Z error: aborting due to previous error
---
2019-09-10T23:09:20.1934726Z 10 
2019-09-10T23:09:20.1934849Z 
2019-09-10T23:09:20.1934967Z 
2019-09-10T23:09:20.1935386Z The actual stderr differed from the expected stderr.
2019-09-10T23:09:20.1935901Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic/generic-extern/generic-extern.stderr
2019-09-10T23:09:20.1936324Z To update references, rerun the tests and pass the `--bless` flag
2019-09-10T23:09:20.1936748Z To only update this specific test, also pass `--test-args generic/generic-extern.rs`
2019-09-10T23:09:20.1937045Z error: 1 errors occurred comparing output.
2019-09-10T23:09:20.1937355Z status: exit code: 1
2019-09-10T23:09:20.1937355Z status: exit code: 1
2019-09-10T23:09:20.1938173Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/generic/generic-extern.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/generic/generic-extern" "-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/generic/generic-extern/auxiliary" "-A" "unused"
2019-09-10T23:09:20.1938898Z ------------------------------------------
2019-09-10T23:09:20.1939080Z 
2019-09-10T23:09:20.1939426Z ------------------------------------------
2019-09-10T23:09:20.1939729Z stderr:
2019-09-10T23:09:20.1939729Z stderr:
2019-09-10T23:09:20.1940084Z ------------------------------------------
2019-09-10T23:09:20.1940317Z error[E0044]: foreign items may not have type parameters
2019-09-10T23:09:20.1940702Z   --> /checkout/src/test/ui/generic/generic-extern.rs:2:5
2019-09-10T23:09:20.1940918Z    |
2019-09-10T23:09:20.1941061Z LL |     fn foo<T>(); //~ ERROR foreign items may not have type parameters
2019-09-10T23:09:20.1942128Z    |
2019-09-10T23:09:20.1942292Z    = help: replace the type parameters with concretetypes like `u32`
2019-09-10T23:09:20.1942492Z 
2019-09-10T23:09:20.1942691Z error: aborting due to previous error
---
2019-09-10T23:09:20.1950912Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-09-10T23:09:20.1950966Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-09-10T23:09:20.1950994Z 
2019-09-10T23:09:20.1951026Z 
2019-09-10T23:09:20.1953303Z 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 -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" "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"
2019-09-10T23:09:20.1953589Z 
2019-09-10T23:09:20.1953724Z 
2019-09-10T23:09:20.1958141Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-09-10T23:09:20.1958215Z Build completed unsuccessfully in 1:07:21
2019-09-10T23:09:20.1958215Z Build completed unsuccessfully in 1:07:21
2019-09-10T23:09:20.2014802Z == clock drift check ==
2019-09-10T23:09:20.2035442Z   local time: Tue Sep 10 23:09:20 UTC 2019
2019-09-10T23:09:20.3593247Z   network time: Tue, 10 Sep 2019 23:09:20 GMT
2019-09-10T23:09:20.3594464Z == end clock drift check ==
2019-09-10T23:09:21.2793254Z ##[error]Bash exited with code '1'.
2019-09-10T23:09:21.2836234Z ##[section]Starting: Checkout
2019-09-10T23:09:21.2837967Z ==============================================================================
2019-09-10T23:09:21.2838033Z Task         : Get sources
2019-09-10T23:09:21.2838073Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@varkor varkor force-pushed the varkor:foreign-items-diagnostic-const-generics branch from f82500b to ef62e05 Sep 10, 2019

@varkor

This comment has been minimized.

Copy link
Member Author

commented Sep 11, 2019

@bors r=cramertj

@bors

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

📌 Commit ef62e05 has been approved by cramertj

Centril added a commit to Centril/rust that referenced this pull request Sep 11, 2019
Rollup merge of rust-lang#64360 - varkor:foreign-items-diagnostic-con…
…st-generics, r=cramertj

Correct the polymorphic extern fn error for const parameters

Before, any polymorphism on extern functions was assumed to be type polymorphism.
bors added a commit that referenced this pull request Sep 12, 2019
Auto merge of #64390 - Centril:rollup-oexzlei, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #64359 (Forbid opaque types in `extern "C"` blocks)
 - #64360 (Correct the polymorphic extern fn error for const parameters)
 - #64372 (use randSecure and randABytes)
 - #64378 (Fix inconsistent link formatting.)
 - #64381 (Upgrade parking_lot and tempfile rustc dependencies)
 - #64384 (Trim rustc-workspace-hack)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

⌛️ Testing commit ef62e05 with merge a5e3de3...

bors added a commit that referenced this pull request Sep 12, 2019
Auto merge of #64360 - varkor:foreign-items-diagnostic-const-generics…
…, r=cramertj

Correct the polymorphic extern fn error for const parameters

Before, any polymorphism on extern functions was assumed to be type polymorphism.
@bors

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

☀️ Test successful - checks-azure
Approved by: cramertj
Pushing a5e3de3 to master...

@bors bors added the merged-by-bors label Sep 13, 2019

@bors bors merged commit ef62e05 into rust-lang:master Sep 13, 2019

5 checks passed

homu Test successful
Details
pr Build #20190910.54 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.