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

Various changes to string format diagnostics #57069

Merged
merged 1 commit into from Dec 27, 2018

Conversation

Projects
None yet
4 participants
@estebank
Copy link
Contributor

estebank commented Dec 22, 2018

  • Point at opening mismatched formatting brace
  • Account for differences between raw and regular strings
  • Account for differences between the code snippet and InternedString
  • Add more tests
error: invalid format string: expected `'}'`, found `'t'`
  --> $DIR/ifmt-bad-arg.rs:85:1
   |
LL | ninth number: {
   |               - because of this opening brace
LL | tenth number: {}",
   | ^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`

Fix #53837.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 22, 2018

r? @cramertj

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

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 22, 2018

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

Click to expand the log.
travis_time:end:0010ef1c:start=1545522018201510058,finish=1545522019324220004,duration=1122709946
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:02:53] tidy error: /checkout/src/test/ui/fmt/format-string-error-2.rs:41: trailing whitespace
[00:02:55] some tidy checks failed
[00:02:55] 
[00:02:55] 
[00:02:55] 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" "--quiet"
[00:02:55] 
[00:02:55] 
[00:02:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:02:55] Build completed unsuccessfully in 0:00:46
[00:02:55] Build completed unsuccessfully in 0:00:46
[00:02:55] make: *** [tidy] Error 1
[00:02:55] Makefile:79: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05e7b582
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Dec 22 23:43:22 UTC 2018
---
travis_time:end:26ae9acc:start=1545522203314739431,finish=1545522203319259019,duration=4519588
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:316d2eec
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:083a8aec
travis_time:start:083a8aec
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0d53a4b0
$ dmesg | grep -i kill

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

@estebank estebank force-pushed the estebank:str-err branch from 33f2592 to 56840df Dec 23, 2018

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 23, 2018

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

Click to expand the log.
travis_time:end:1eb06b4a:start=1545525159190793511,finish=1545525160305920687,duration=1115127176
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:07:52] 
[01:07:52] running 118 tests
[01:08:15] .iiiii...i.....i..i...i..i.i..i.ii..i.....i..i....i..........iiii..........i...ii...i.......ii.i.i.i 100/118
[01:08:19] ......iii.i.....ii
[01:08:19] 
[01:08:19]  finished in 27.440
[01:08:19] travis_fold:end:test_debuginfo

---
[01:28:26]    --> src/libfmt_macros/lib.rs:630:22
[01:28:26]     |
[01:28:26] 229 | /     pub fn new(
[01:28:26] 230 | |         s: &'a str,
[01:28:26] 231 | |         style: Option<usize>,
[01:28:26] 232 | |         skips: Vec<usize>,
[01:28:26] 245 | |         }
[01:28:26] 246 | |     }
[01:28:26]     | |_____- defined here
[01:28:26] ...

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

@estebank estebank force-pushed the estebank:str-err branch from 56840df to e806538 Dec 23, 2018

@cramertj

This comment has been minimized.

Copy link
Member

cramertj commented Dec 26, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2018

📌 Commit e806538 has been approved by cramertj

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2018

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2018

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

Various changes to string format diagnostics
- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

@estebank estebank force-pushed the estebank:str-err branch from e806538 to 862ebc4 Dec 26, 2018

@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Dec 26, 2018

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2018

📌 Commit 862ebc4 has been approved by @cramertj

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 27, 2018

⌛️ Testing commit 862ebc4 with merge a1bad57...

bors added a commit that referenced this pull request Dec 27, 2018

Auto merge of #57069 - estebank:str-err, r=@cramertj
Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

```
error: invalid format string: expected `'}'`, found `'t'`
  --> $DIR/ifmt-bad-arg.rs:85:1
   |
LL | ninth number: {
   |               - because of this opening brace
LL | tenth number: {}",
   | ^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
```

Fix #53837.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 27, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: @cramertj
Pushing a1bad57 to master...

@bors bors merged commit 862ebc4 into rust-lang:master Dec 27, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 27, 2018

📣 Toolstate changed by #57069!

Tested on commit a1bad57.
Direct link to PR: #57069

💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Dec 27, 2018

📣 Toolstate changed by rust-lang/rust#57069!
Tested on commit rust-lang/rust@a1bad57.
Direct link to PR: <rust-lang/rust#57069>

💔 clippy-driver on windows: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-fail → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc @Xanewok, @rust-lang/infra).

matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 27, 2018

bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 27, 2018

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 27, 2018

submodules: update clippy from fc24fce7 to 721f688e
Fixes clippy toolstate.

Changes:
````
rustup rust-lang#57069
Rustfmt.
fix breakage from rust-lang#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 28, 2018

submodules: update clippy from fc24fce7 to f7bdf500
Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup rust-lang#57069
Rustfmt.
fix breakage from rust-lang#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

bors added a commit that referenced this pull request Dec 28, 2018

Auto merge of #57138 - matthiaskrgr:clippy, r=oli-obk
submodules: update clippy from fc24fce7 to 721f688e

Fixes clippy toolstate.

Changes:
````
rustup #57069
Rustfmt.
fix breakage from #57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

r? @oli-obk

bors added a commit that referenced this pull request Dec 28, 2018

Auto merge of #57138 - matthiaskrgr:clippy, r=oli-obk
submodules: update clippy from fc24fce7 to 721f688e

Fixes clippy toolstate.

Changes:
````
rustup #57069
Rustfmt.
fix breakage from #57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

r? @oli-obk

mark-i-m added a commit to mark-i-m/rust that referenced this pull request Dec 29, 2018

submodules: update clippy from fc24fce7 to f7bdf500
Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup rust-lang#57069
Rustfmt.
fix breakage from rust-lang#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jan 5, 2019

submodules: update clippy from fc24fce7 to f7bdf500
Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup rust-lang#57069
Rustfmt.
fix breakage from rust-lang#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment