Skip to content

Consistent rounding rules for float display with fixed precision #70751

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

Closed

Conversation

ayushmishra2005
Copy link
Contributor

@rust-highfive
Copy link
Contributor

r? @cramertj

(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 Apr 3, 2020
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-7 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.
2020-04-03T22:20:45.0624535Z ========================== Starting Command Output ===========================
2020-04-03T22:20:45.0627448Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/5f76bc42-66a8-4178-a34f-d85d03e68185.sh
2020-04-03T22:20:45.0627738Z 
2020-04-03T22:20:45.0631974Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-03T22:20:45.0663672Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70751/merge to s
2020-04-03T22:20:45.0666887Z Task         : Get sources
2020-04-03T22:20:45.0667199Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-03T22:20:45.0667496Z Version      : 1.0.0
2020-04-03T22:20:45.0667698Z Author       : Microsoft
---
2020-04-03T22:20:46.0705447Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-03T22:20:46.0712371Z ##[command]git config gc.auto 0
2020-04-03T22:20:46.0716002Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-03T22:20:46.0719190Z ##[command]git config --get-all http.proxy
2020-04-03T22:20:46.0725159Z ##[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/70751/merge:refs/remotes/pull/70751/merge
---
2020-04-03T22:22:53.2621525Z Looks like docker image is the same as before, not uploading
2020-04-03T22:23:01.2628260Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-03T22:23:01.2916574Z [CI_JOB_NAME=x86_64-gnu-llvm-7]
2020-04-03T22:23:01.2935011Z == clock drift check ==
2020-04-03T22:23:01.2944104Z   local time: Fri Apr  3 22:23:01 UTC 2020
2020-04-03T22:23:01.3630041Z   network time: Fri, 03 Apr 2020 22:23:01 GMT
2020-04-03T22:23:01.3654945Z Starting sccache server...
2020-04-03T22:23:01.4476908Z configure: processing command line
2020-04-03T22:23:01.4477181Z configure: 
2020-04-03T22:23:01.4478092Z configure: rust.dist-src        := False
---
2020-04-03T22:27:58.8053473Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-03T22:28:00.1794475Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-03T22:28:01.6724312Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-03T22:28:02.6009998Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-03T22:28:11.2007860Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-03T22:28:13.0067572Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-03T22:28:17.1106541Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-03T22:28:20.9971720Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-03T22:28:30.2931801Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-03T22:49:13.5056852Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-03T22:49:15.1867602Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-03T22:49:17.1188538Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-03T22:49:18.2845069Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-03T22:49:28.8948030Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-03T22:49:30.8756978Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-03T22:49:35.8725090Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-03T22:49:41.0399218Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-03T22:49:51.9030441Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-03T23:14:13.1008391Z .................................................................................................... 1700/9872
2020-04-03T23:14:17.1158637Z .................................................................................................... 1800/9872
2020-04-03T23:14:26.0462879Z ...............................................................................................i.... 1900/9872
2020-04-03T23:14:33.8622832Z .................................................................................................... 2000/9872
2020-04-03T23:14:40.1902158Z .....................................................................................iiiii.......... 2100/9872
2020-04-03T23:15:00.3625695Z .................................................................................................... 2300/9872
2020-04-03T23:15:02.4164251Z .................................................................................................... 2400/9872
2020-04-03T23:15:04.6128770Z .................................................................................................... 2500/9872
2020-04-03T23:15:10.5459618Z .................................................................................................... 2600/9872
---
2020-04-03T23:17:57.8995630Z ...........................................................i...............i........................ 5000/9872
2020-04-03T23:18:04.9558786Z .................................................................................................... 5100/9872
2020-04-03T23:18:12.2442579Z .................................................................................................... 5200/9872
2020-04-03T23:18:17.1449193Z ....i............................................................................................... 5300/9872
2020-04-03T23:18:26.8145469Z ............................................................................................ii.ii... 5400/9872
2020-04-03T23:18:31.2357733Z .....i...i.......................................................................................... 5500/9872
2020-04-03T23:18:39.7279733Z .....................................i.............................................................. 5700/9872
2020-04-03T23:18:49.5048761Z .........................................................ii.....................................i... 5800/9872
2020-04-03T23:18:57.2120785Z .................................................................................................... 5900/9872
2020-04-03T23:19:01.9914614Z .................................................................................................... 6000/9872
2020-04-03T23:19:01.9914614Z .................................................................................................... 6000/9872
2020-04-03T23:19:11.4505673Z .........................................................................................ii...i..ii. 6100/9872
2020-04-03T23:19:31.6548364Z .................................................................................................... 6300/9872
2020-04-03T23:19:38.6668285Z .................................................................................................... 6400/9872
2020-04-03T23:19:41.6769890Z .................................................................................................... 6500/9872
2020-04-03T23:19:41.6769890Z .................................................................................................... 6500/9872
2020-04-03T23:19:53.7877088Z ...................i..ii............................................................................ 6600/9872
2020-04-03T23:20:14.0135407Z .................................................................................................... 6800/9872
2020-04-03T23:20:16.0119570Z ...................i................................................................................ 6900/9872
2020-04-03T23:20:18.0317696Z .................................................................................................... 7000/9872
2020-04-03T23:20:20.1715831Z ..........................................................i......................................... 7100/9872
---
2020-04-03T23:21:55.0869480Z .................................................................................................... 7800/9872
2020-04-03T23:21:59.3615272Z .................................................................................................... 7900/9872
2020-04-03T23:22:04.9491120Z .................................................................................................... 8000/9872
2020-04-03T23:22:12.6231544Z ......................i............................................................................. 8100/9872
2020-04-03T23:22:20.2223756Z .......................................................................iiiiiiiiii.i................. 8200/9872
2020-04-03T23:22:35.2308782Z ...............i......i............................................................................. 8400/9872
2020-04-03T23:22:39.8251289Z .................................................................................................... 8500/9872
2020-04-03T23:22:50.6445573Z .................................................................................................... 8600/9872
2020-04-03T23:23:02.0949244Z .................................................................................................... 8700/9872
---
2020-04-03T23:24:52.4515430Z ------------------------------------------
2020-04-03T23:24:52.4515832Z stderr:
2020-04-03T23:24:52.4516357Z ------------------------------------------
2020-04-03T23:24:52.4517037Z thread 'main' panicked at 'assertion failed: `(left == right)`
2020-04-03T23:24:52.4518325Z   left: `"1.235e6"`,
2020-04-03T23:24:52.4518946Z  right: `"1.234e6"`', /checkout/src/test/ui/ifmt.rs:147:5
2020-04-03T23:24:52.4519760Z 
2020-04-03T23:24:52.4520406Z ------------------------------------------
2020-04-03T23:24:52.4520702Z 
2020-04-03T23:24:52.4520925Z 
---
2020-04-03T23:24:52.4535955Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:348:22
2020-04-03T23:24:52.4536709Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-04-03T23:24:52.4548574Z 
2020-04-03T23:24:52.4548917Z 
2020-04-03T23:24:52.4552942Z 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-7/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" "7.0.0" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-04-03T23:24:52.4558088Z 
2020-04-03T23:24:52.4558351Z 
2020-04-03T23:24:52.4559185Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-03T23:24:52.4559577Z Build completed unsuccessfully in 1:00:13
2020-04-03T23:24:52.4559577Z Build completed unsuccessfully in 1:00:13
2020-04-03T23:24:52.4615182Z == clock drift check ==
2020-04-03T23:24:52.4637998Z   local time: Fri Apr  3 23:24:52 UTC 2020
2020-04-03T23:24:52.5352643Z   network time: Fri, 03 Apr 2020 23:24:52 GMT
2020-04-03T23:24:52.9558359Z 
2020-04-03T23:24:52.9558359Z 
2020-04-03T23:24:52.9649095Z ##[error]Bash exited with code '1'.
2020-04-03T23:24:52.9662783Z ##[section]Finishing: Run build
2020-04-03T23:24:52.9710152Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70751/merge to s
2020-04-03T23:24:52.9715174Z Task         : Get sources
2020-04-03T23:24:52.9715530Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-03T23:24:52.9715856Z Version      : 1.0.0
2020-04-03T23:24:52.9716098Z Author       : Microsoft
2020-04-03T23:24:52.9716098Z Author       : Microsoft
2020-04-03T23:24:52.9716458Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-03T23:24:52.9716877Z ==============================================================================
2020-04-03T23:24:53.3165889Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-03T23:24:53.3210247Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70751/merge to s
2020-04-03T23:24:53.3294895Z Cleaning up task key
2020-04-03T23:24:53.3296391Z Start cleaning up orphan processes.
2020-04-03T23:24:53.3498363Z Terminate orphan process: pid (3617) (python)
2020-04-03T23:24:53.3669204Z ##[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)

@joelpalmer joelpalmer added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 14, 2020
@Dylan-DPC-zz
Copy link

r? @dtolnay

@rust-highfive rust-highfive assigned dtolnay and unassigned cramertj Apr 14, 2020
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

I haven't gotten a chance to review the implementation yet but it looks like there is some test code commented out in flt2dec/mod.rs that probably shouldn't be. Is that on purpose? What's the deal with those tests?

Comment on lines -147 to +150
t!(format!("{:.3e}", 1.2345e6f64), "1.234e6");
t!(format!("{:10.3e}", 1.2345e6f64), " 1.234e6");
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.234e6");
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.234e6");
t!(format!("{:.3e}", 1.2345e6f64), "1.235e6");
t!(format!("{:10.3e}", 1.2345e6f64), " 1.235e6");
t!(format!("{:+10.3e}", 1.2345e6f64), " +1.235e6");
t!(format!("{:+10.3e}", -1.2345e6f64), " -1.235e6");
Copy link
Member

Choose a reason for hiding this comment

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

It looks to me like these were correct before. Round-to-even on 1234.5 should go to 1234, not 1235.

@crlf0710
Copy link
Member

@ayushmishra2005 Ping from triage, would you mind addressing the review comments above? thanks

@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2020
@ayushmishra2005
Copy link
Contributor Author

@crlf0710 I am closing this pull request for now because I don't have the bandwidth to address them. I will raise new PR after addressing the above comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants