Skip to content

Highlight only relevant parts of type path in type errors #65779

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

Merged
merged 2 commits into from
Nov 3, 2019

Conversation

kevgrasso
Copy link
Contributor

Resolves #57413.

Unfortunately the current Rust UI testing setup can't test that the correct colors are being used in a given output, so here's a screenshot of a small test program I wrote:
image

@rust-highfive
Copy link
Contributor

r? @petrochenkov

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

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

The job x86_64-gnu-llvm-6.0 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.
2019-10-24T22:33:19.1276764Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-24T22:33:19.1506318Z ##[command]git config gc.auto 0
2019-10-24T22:33:19.1603652Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-24T22:33:19.1679891Z ##[command]git config --get-all http.proxy
2019-10-24T22:33:19.1837558Z ##[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/65779/merge:refs/remotes/pull/65779/merge
---
2019-10-24T23:35:31.3113506Z .................................................................................................... 1600/9241
2019-10-24T23:35:36.8275661Z .................................................................................................... 1700/9241
2019-10-24T23:35:49.6224842Z .....................................................i...............i.............................. 1800/9241
2019-10-24T23:35:57.7016958Z .................................................................................................... 1900/9241
2019-10-24T23:36:12.1681555Z ...........................................iiiii.................................................... 2000/9241
2019-10-24T23:36:22.9625465Z .................................................................................................... 2200/9241
2019-10-24T23:36:25.5660473Z .................................................................................................... 2300/9241
2019-10-24T23:36:29.7487331Z .................................................................................................... 2400/9241
2019-10-24T23:36:52.8209507Z .................................................................................................... 2500/9241
---
2019-10-24T23:39:47.7367610Z ...............................................i...............i.................................... 4800/9241
2019-10-24T23:39:57.1553533Z .................................................................................................... 4900/9241
2019-10-24T23:40:06.1959180Z .................................................................................................... 5000/9241
2019-10-24T23:40:13.0705744Z .................................................................................................... 5100/9241
2019-10-24T23:40:23.0365756Z ...............................................ii.ii................................................ 5200/9241
2019-10-24T23:40:33.2228424Z .................................................................................................... 5400/9241
2019-10-24T23:40:43.0378680Z .................................................................................................... 5500/9241
2019-10-24T23:40:50.5109435Z ..............i..................................................................................... 5600/9241
2019-10-24T23:40:56.0994480Z .................................................................................................... 5700/9241
2019-10-24T23:40:56.0994480Z .................................................................................................... 5700/9241
2019-10-24T23:41:08.3593157Z .................................................................................................... 5800/9241
2019-10-24T23:41:20.3827518Z ...........ii...i..ii...........i................................................................... 5900/9241
2019-10-24T23:41:42.1131295Z .................................................................................................... 6100/9241
2019-10-24T23:41:50.1061316Z .................................................................................................... 6200/9241
2019-10-24T23:41:50.1061316Z .................................................................................................... 6200/9241
2019-10-24T23:42:04.1458336Z .................................i..ii.............................................................. 6300/9241
2019-10-24T23:42:25.1985503Z ...................................................................................................i 6500/9241
2019-10-24T23:42:27.4594275Z .................................................................................................... 6600/9241
2019-10-24T23:42:29.7874205Z ..........................................................................i......................... 6700/9241
2019-10-24T23:42:32.6008759Z .................................................................................................... 6800/9241
---
2019-10-24T23:46:41.4421706Z failures:
2019-10-24T23:46:41.4449573Z 
2019-10-24T23:46:41.4450066Z ---- [ui] ui/type/type-mismatch-same-crate-name.rs stdout ----
2019-10-24T23:46:41.4450107Z 
2019-10-24T23:46:41.4450176Z error: Error: expected failure status (Some(1)) but received status Some(101).
2019-10-24T23:46:41.4450219Z status: exit code: 101
2019-10-24T23:46:41.4450888Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/type/type-mismatch-same-crate-name.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/type/type-mismatch-same-crate-name" "-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/type/type-mismatch-same-crate-name/auxiliary" "-A" "unused"
2019-10-24T23:46:41.4451191Z ------------------------------------------
2019-10-24T23:46:41.4451228Z 
2019-10-24T23:46:41.4489721Z ------------------------------------------
2019-10-24T23:46:41.4489816Z stderr:
2019-10-24T23:46:41.4489816Z stderr:
2019-10-24T23:46:41.4490179Z ------------------------------------------
2019-10-24T23:46:41.4490426Z thread 'rustc' panicked at 'byte index 14 is out of bounds of `main::a::Foo`', src/libcore/str/mod.rs:2051:9
2019-10-24T23:46:41.4490535Z 
2019-10-24T23:46:41.4490572Z error: internal compiler error: unexpected panic
2019-10-24T23:46:41.4490614Z 
2019-10-24T23:46:41.4490652Z note: the compiler unexpectedly panicked. this is a bug.
2019-10-24T23:46:41.4490652Z note: the compiler unexpectedly panicked. this is a bug.
2019-10-24T23:46:41.4490676Z 
2019-10-24T23:46:41.4491077Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-10-24T23:46:41.4495353Z note: rustc 1.40.0-dev running on x86_64-unknown-linux-gnu
2019-10-24T23:46:41.4495415Z 
2019-10-24T23:46:41.4495415Z 
2019-10-24T23:46:41.4496009Z note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0
2019-10-24T23:46:41.4496108Z 
2019-10-24T23:46:41.4496396Z ------------------------------------------
2019-10-24T23:46:41.4496429Z 
2019-10-24T23:46:41.4496476Z 
---
2019-10-24T23:46:41.4501785Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-10-24T23:46:41.4501884Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-10-24T23:46:41.4518767Z 
2019-10-24T23:46:41.4524023Z 
2019-10-24T23:46:41.4526428Z 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-10-24T23:46:41.4526833Z 
2019-10-24T23:46:41.4526884Z 
2019-10-24T23:46:41.4530502Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-10-24T23:46:41.4530567Z Build completed unsuccessfully in 1:06:52
2019-10-24T23:46:41.4530567Z Build completed unsuccessfully in 1:06:52
2019-10-24T23:46:41.4595202Z == clock drift check ==
2019-10-24T23:46:41.4610484Z   local time: Thu Oct 24 23:46:41 UTC 2019
2019-10-24T23:46:41.7425826Z   network time: Thu, 24 Oct 2019 23:46:41 GMT
2019-10-24T23:46:41.7433637Z == end clock drift check ==
2019-10-24T23:46:42.8487374Z 
2019-10-24T23:46:42.8583275Z ##[error]Bash exited with code '1'.
2019-10-24T23:46:42.8655842Z ##[section]Starting: Checkout
2019-10-24T23:46:42.8657688Z ==============================================================================
2019-10-24T23:46:42.8657930Z Task         : Get sources
2019-10-24T23:46:42.8657986Z 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)

@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-6.0 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.
2019-10-25T04:12:52.0720376Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-10-25T04:12:52.0969585Z ##[command]git config gc.auto 0
2019-10-25T04:12:52.1028540Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-10-25T04:12:52.1093215Z ##[command]git config --get-all http.proxy
2019-10-25T04:12:52.1238746Z ##[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/65779/merge:refs/remotes/pull/65779/merge
---
2019-10-25T04:19:19.9705752Z    Compiling serde_json v1.0.40
2019-10-25T04:19:21.9218351Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-10-25T04:19:34.2667458Z     Finished release [optimized] target(s) in 1m 35s
2019-10-25T04:19:34.2750378Z tidy check
2019-10-25T04:19:35.0204366Z tidy error: /checkout/src/librustc/infer/error_reporting/mod.rs:1078: trailing whitespace
2019-10-25T04:19:36.7381460Z Found 483 error codes
2019-10-25T04:19:36.7384281Z Found 0 error codes with no tests
2019-10-25T04:19:36.7384342Z Done!
2019-10-25T04:19:36.7384409Z some tidy checks failed
2019-10-25T04:19:36.7384409Z some tidy checks failed
2019-10-25T04:19:36.7389978Z 
2019-10-25T04:19:36.7390306Z 
2019-10-25T04:19:36.7391372Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-10-25T04:19:36.7391804Z 
2019-10-25T04:19:36.7392089Z 
2019-10-25T04:19:36.7392249Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-10-25T04:19:36.7392389Z Build completed unsuccessfully in 0:01:38
2019-10-25T04:19:36.7392389Z Build completed unsuccessfully in 0:01:38
2019-10-25T04:19:36.7433010Z == clock drift check ==
2019-10-25T04:19:36.7445631Z   local time: Fri Oct 25 04:19:36 UTC 2019
2019-10-25T04:19:36.8322323Z   network time: Fri, 25 Oct 2019 04:19:36 GMT
2019-10-25T04:19:36.8332388Z == end clock drift check ==
2019-10-25T04:19:38.1834387Z 
2019-10-25T04:19:38.1945197Z ##[error]Bash exited with code '1'.
2019-10-25T04:19:38.1979662Z ##[section]Starting: Checkout
2019-10-25T04:19:38.1981736Z ==============================================================================
2019-10-25T04:19:38.1981789Z Task         : Get sources
2019-10-25T04:19:38.1981833Z 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)

@petrochenkov
Copy link
Contributor

r? @estebank

@JohnCSimon
Copy link
Member

Ping from triage
@estebank Can you please review this PR?
cc: @kevgrasso @petrochenkov
Thank you!

@estebank
Copy link
Contributor

estebank commented Nov 2, 2019

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 2, 2019

📌 Commit 2337bbb has been approved by estebank

@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 Nov 2, 2019
@bors
Copy link
Collaborator

bors commented Nov 3, 2019

⌛ Testing commit 2337bbb with merge aa51f04...

bors added a commit that referenced this pull request Nov 3, 2019
Highlight only relevant parts of type path in type errors

Resolves #57413.

Unfortunately the current Rust UI testing setup can't test that the correct colors are being used in a given output, so here's a screenshot of a small test program I wrote:
![image](https://user-images.githubusercontent.com/480789/67530063-f272af00-f68b-11e9-9f96-a211fc7666d4.png)
@bors
Copy link
Collaborator

bors commented Nov 3, 2019

☀️ Test successful - checks-azure
Approved by: estebank
Pushing aa51f04 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 3, 2019
@bors bors merged commit 2337bbb into rust-lang:master Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Highlight only relevant parts of type path in type errors
6 participants