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

Use Symbol, Span in libfmt_macros #61568

Merged
merged 7 commits into from Jun 12, 2019

Conversation

Projects
None yet
4 participants
@Mark-Simulacrum
Copy link
Member

commented Jun 6, 2019

I'm not super happy with this, personally, but I think it might be a decent start -- happy to take suggestions as to how to expand this or change things further.

r? @estebank

Fixes #60795

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Jun 6, 2019

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:0b908520:start=1559779761313553578,finish=1559779762125530010,duration=811976432
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---

[00:04:37] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:38] tidy error: /checkout/src/libfmt_macros/lib.rs:428: line longer than 100 chars
[00:04:43] some tidy checks failed
[00:04:43] 
[00:04:43] 
[00:04:43] 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:04:43] 
[00:04:43] 
[00:04:43] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:43] Build completed unsuccessfully in 0:01:16
---
travis_time:end:2dd66368:start=1559780057365794538,finish=1559780057370894217,duration=5099679
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1d83dfc3
$ 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:3b65e59c
travis_time:start:3b65e59c
$ 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:05f32988
$ 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)

let curr_last_brace = self.last_opening_brace;
let byte_pos = self.to_span_index(pos);
self.last_opening_brace =
Some(Span::new(byte_pos, byte_pos, SyntaxContext::empty()));

This comment has been minimized.

Copy link
@estebank

estebank Jun 6, 2019

Contributor

I think this needs to be Span::new(byte_pos, byte_pos + 1, SyntaxContext::empty()) if we want the Span to point at the } and not the space between whatever comes right before the brace and the brace itself.

This comment has been minimized.

Copy link
@Mark-Simulacrum

Mark-Simulacrum Jun 6, 2019

Author Member

I'll wait to do anything here pending resolution of whether we want to be using Spans at all, though I think this is strictly "the same" as what we had before in any case so it's at least consistent if, well, wrong. :)

This comment has been minimized.

Copy link
@estebank

estebank Jun 6, 2019

Contributor

Hurray for uncovering subtle bugs that would otherwise had gone undetected.

if let Some((label, start, end)) = err.secondary_label {
let sp = fmt.span.from_inner_byte_pos(start.unwrap(), end.unwrap());
if let Some((label, span)) = err.secondary_label {
let sp = fmt.span.from_inner(span);

This comment has been minimized.

Copy link
@estebank

estebank Jun 6, 2019

Contributor

I'm not sure whether this makes sense. span should already be based of the codemap, right? If not, then I'm not sure we should be using Spans there to avoid mixing Spans that are valid in some contexts and not others.

This comment has been minimized.

Copy link
@Mark-Simulacrum

Mark-Simulacrum Jun 6, 2019

Author Member

It looks like the machinery in libfmt_macros is used from two places in the compiler: parsing format_args! literals in println, format, etc. and in parsing the attribute to rustc_on_unimplemented. The first has the relevant span information AFAICT fully, but the latter we don't appear to have good spans for it looks like we just have the span for all of rustc_on_unimplemented = "..." not just the "..." bit.

I'm happy to revert the bits which move libfmt_macros to using "fake" spans and back to (SpanIndex, SpanIndex). I don't feel great about that since it seems worse than the inner spans.

This comment has been minimized.

Copy link
@estebank

estebank Jun 6, 2019

Contributor

Could we new type wrap them? That way we won't be able to accidentally pass an InnerSpan somewhere a Span is expected. At the very least we should add generous comments about what's happening here. You're right that it seems better than the status quo.

This comment has been minimized.

Copy link
@Mark-Simulacrum

Mark-Simulacrum Jun 6, 2019

Author Member

I'll do that. I agree that just Span is probably not great. I'll also try to eliminate the other uses of from_inner_byte_pos.

@Mark-Simulacrum Mark-Simulacrum force-pushed the Mark-Simulacrum:symbol-fmt-macros branch from a66c29e to 966754a Jun 7, 2019

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

Okay, I've updated with new code and an InnerSpan abstraction.

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Jun 7, 2019

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:00d4f79c:start=1559872029610227710,finish=1559872031890594390,duration=2280366680
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:10] 
[01:05:10] running 144 tests
[01:05:13] i..iii.....iii..iiii.....i......................i..i.................i.....i..........ii.i..i..i.ii. 100/144
[01:05:15] test result: ok. 114 passed; 0 failed; 30 ignored; 0 measured; 0 filtered out
[01:05:15] 
[01:05:15]  finished in 4.634
[01:05:15] travis_fold:end:test_codegen
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:17] 
[01:05:17] running 9 tests
[01:05:17] iiiiiiiii
[01:05:17] 
[01:05:17]  finished in 0.156
[01:05:17] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:33] 
[01:05:33] running 122 tests
[01:05:59] .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:06:04] .i.i......iii.i.....ii
[01:06:04] 
[01:06:04]  finished in 30.925
[01:06:04] travis_fold:end:test_debuginfo

---
[01:25:48]     Finished release [optimized] target(s) in 1.26s
[01:25:48]      Running build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/fmt_macros-2711e98f75b71201
[01:25:48] 
[01:25:48] running 14 tests
[01:25:48] ......F.......
[01:25:48] 
[01:25:48] ---- tests::format_counts stdout ----
[01:25:48] ---- tests::format_counts stdout ----
[01:25:48] thread 'tests::format_counts' panicked at 'cannot access a scoped thread local variable without calling `set` first', /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:168:9
[01:25:48] 
[01:25:48] 
[01:25:48] failures:
[01:25:48]     tests::format_counts
[01:25:48]     tests::format_counts
[01:25:48] 
[01:25:48] test result: FAILED. 13 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:25:48] 
[01:25:48] error: test failed, to rerun pass '-p fmt_macros --lib'
[01:25:48] 
[01:25:48] 
[01:25:48] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "fmt_macros" "--" "--quiet"
[01:25:48] 
[01:25:48] 
[01:25:48] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:25:48] Build completed unsuccessfully in 1:21:49

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)

@bors

This comment was marked as outdated.

Copy link
Contributor

commented Jun 7, 2019

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

@Mark-Simulacrum Mark-Simulacrum force-pushed the Mark-Simulacrum:symbol-fmt-macros branch from c024dde to f99f465 Jun 7, 2019

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

Rebased and hopefully fixed the test failure.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Jun 7, 2019

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:07159332:start=1559916312078052667,finish=1559916314325828546,duration=2247775879
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:06:11] 
[01:06:11] running 144 tests
[01:06:14] i..iii.....iii..iiii.....i......................i...i................i.....i..........ii.i..i..i.ii. 100/144
[01:06:15] test result: ok. 114 passed; 0 failed; 30 ignored; 0 measured; 0 filtered out
[01:06:15] 
[01:06:15]  finished in 4.695
[01:06:15] travis_fold:end:test_codegen
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:06:18] 
[01:06:18] running 9 tests
[01:06:18] iiiiiiiii
[01:06:18] 
[01:06:18]  finished in 0.158
[01:06:18] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:06:34] 
[01:06:34] running 122 tests
[01:07:00] .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:07:05] .i.i......iii.i.....ii
[01:07:05] 
[01:07:05]  finished in 30.738
[01:07:05] travis_fold:end:test_debuginfo

---
[01:31:47]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:663:52
[01:31:49]     |
[01:31:49] 663 |                 { None, "", None, None, None, "!", (0, 2), });
[01:31:49]     |                                                    ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:665:52
[01:31:49]     |
[01:31:49]     |
[01:31:49] 665 |                 { None, "", None, None, None, "c", (0, 2), });
[01:31:49]     |                                                    ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:667:52
[01:31:49]     |
[01:31:49]     |
[01:31:49] 667 |                 { None, "", None, None, None, "s", (0, 2), });
[01:31:49]     |                                                    ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:669:64
[01:31:49]     |
[01:31:49]     |
[01:31:49] 669 |                 { None, "0", Some(N::Num(6)), None, None, "d", (0, 4), });
[01:31:49]     |                                                                ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:671:74
[01:31:49]     |
[01:31:49]     |
[01:31:49] 671 |                 { None, "", Some(N::Num(4)), Some(N::Num(2)), None, "f", (0, 5), });
[01:31:49]     |                                                                          ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:673:53
[01:31:49]     |
[01:31:49]     |
[01:31:49] 673 |                 { None, "#", None, None, None, "x", (0, 3), });
[01:31:49]     |                                                     ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:675:65
[01:31:49]     |
[01:31:49]     |
[01:31:49] 675 |                 { None, "-", Some(N::Num(10)), None, None, "s", (0, 5), });
[01:31:49]     |                                                                 ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:677:61
[01:31:49]     |
[01:31:49]     |
[01:31:49] 677 |                 { None, "", Some(N::Next), None, None, "s", (0, 3), });
[01:31:49]     |                                                             ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:679:74
[01:31:49]     |
[01:31:49]     |
[01:31:49] 679 |                 { None, "-", Some(N::Num(10)), Some(N::Next), None, "s", (0, 7), });
[01:31:49]     |                                                                          ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:681:71
[01:31:49]     |
[01:31:49]     |
[01:31:49] 681 |                 { None, "-", Some(N::Next), Some(N::Next), None, "s", (0, 6), });
[01:31:49]     |                                                                       ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:683:63
[01:31:49]     |
[01:31:49]     |
[01:31:49] 683 |                 { None, "", None, Some(N::Num(6)), None, "i", (0, 4), });
[01:31:49]     |                                                               ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:685:53
[01:31:49]     |
[01:31:49]     |
[01:31:49] 685 |                 { None, "+", None, None, None, "i", (0, 3), });
[01:31:49]     |                                                     ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:687:64
[01:31:49]     |
[01:31:49]     |
[01:31:49] 687 |                 { None, "0", Some(N::Num(8)), None, None, "X", (0, 4), });
[01:31:49]     |                                                                ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:689:57
[01:31:49]     |
[01:31:49]     |
[01:31:49] 689 |                 { None, "", None, None, Some("l"), "u", (0, 3), });
[01:31:49]     |                                                         ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:691:57
[01:31:49]     |
[01:31:49]     |
[01:31:49] 691 |                 { None, "", None, None, Some("I"), "u", (0, 3), });
[01:31:49]     |                                                         ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:49] error[E0308]: mismatched types
[01:31:49]    --> src/libsyntax_ext/format_foreign.rs:693:59
[01:31:49]     |
[01:31:49]     |
[01:31:49] 693 |                 { None, "", None, None, Some("I32"), "u", (0, 5), });
[01:31:49]     |                                                           ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:49]     |
[01:31:49]     = note: expected type `syntax_pos::InnerSpan`
[01:31:49]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:695:59
[01:31:50]     |
[01:31:50]     |
[01:31:50] 695 |                 { None, "", None, None, Some("I64"), "u", (0, 5), });
[01:31:50]     |                                                           ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:697:53
[01:31:50]     |
[01:31:50]     |
[01:31:50] 697 |                 { None, "'", None, None, None, "d", (0, 3), });
[01:31:50]     |                                                     ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:699:64
[01:31:50]     |
[01:31:50]     |
[01:31:50] 699 |                 { None, "", Some(N::Num(10)), None, None, "s", (0, 4), });
[01:31:50]     |                                                                ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:701:77
[01:31:50]     |
[01:31:50]     |
[01:31:50] 701 |                 { None, "-", Some(N::Num(10)), Some(N::Num(10)), None, "s", (0, 8), });
[01:31:50]     |                                                                             ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:703:55
[01:31:50]     |
[01:31:50]     |
[01:31:50] 703 |                 { Some(1), "", None, None, None, "d", (0, 4), });
[01:31:50]     |                                                       ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:705:66
[01:31:50]     |
[01:31:50]     |
[01:31:50] 705 |                 { Some(2), "", None, Some(N::Arg(3)), None, "d", (0, 8), });
[01:31:50]     |                                                                  ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:707:77
[01:31:50]     |
[01:31:50]     |
[01:31:50] 707 |                 { Some(1), "", Some(N::Arg(2)), Some(N::Arg(3)), None, "d", (0, 11), });
[01:31:50]     |                                                                             ^^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0308]: mismatched types
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:709:69
[01:31:50]     |
[01:31:50]     |
[01:31:50] 709 |                 { None, "-", Some(N::Num(8)), None, Some("l"), "d", (0, 5), });
[01:31:50]     |                                                                     ^^^^^^ expected struct `syntax_pos::InnerSpan`, found tuple
[01:31:50]     |
[01:31:50]     = note: expected type `syntax_pos::InnerSpan`
[01:31:50]                found type `({integer}, {integer})`
[01:31:50] error[E0061]: this function takes 2 parameters but 1 parameter was supplied
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:715:32
[01:31:50]     |
[01:31:50]     |
[01:31:50] 267 |     pub fn iter_subs(s: &str, start_pos: usize) -> Substitutions<'_> {
[01:31:50]     |     ---------------------------------------------------------------- defined here
[01:31:50] ...
[01:31:50] 715 |             let subs: Vec<_> = iter_subs(s).map(|sub| sub.translate()).collect();
[01:31:50] 
[01:31:50] error[E0061]: this function takes 2 parameters but 1 parameter was supplied
[01:31:50]    --> src/libsyntax_ext/format_foreign.rs:945:32
[01:31:50]     |
[01:31:50]     |
[01:31:50] 809 |     pub fn iter_subs(s: &str, start_pos: usize) -> Substitutions<'_> {
[01:31:50]     |     ---------------------------------------------------------------- defined here
[01:31:50] ...
[01:31:50] 945 |             let subs: Vec<_> = iter_subs(s).map(|sub| sub.translate()).collect();
[01:31:50] 
[01:31:50] error: aborting due to 26 previous errors
[01:31:50] 
[01:31:50] Some errors have detailed explanations: E0061, E0308.
[01:31:50] Some errors have detailed explanations: E0061, E0308.
[01:31:50] For more information about an error, try `rustc --explain E0061`.
[01:31:50] error: Could not compile `syntax_ext`.
[01:31:50] 
[01:31:50] To learn more, run the command again with --verbose.
[01:31:50] 
[01:31:50] 
[01:31:50] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "syntax_ext" "--" "--quiet"
[01:31:50] 
[01:31:50] 
[01:31:50] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:31:50] Build completed unsuccessfully in 1:26:43

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)

Mark-Simulacrum added some commits Jun 4, 2019

Introduce InnerSpan abstraction
This should be used when trying to get at subsets of a larger span,
especially when the larger span is not available in the code attempting
to work with those subsets (especially common in the fmt_macros crate).

This is usually a good replacement for (BytePos, BytePos) and (usize,
usize) tuples.

This commit also removes from_inner_byte_pos, since it took usize
arguments, which is error prone.

@Mark-Simulacrum Mark-Simulacrum force-pushed the Mark-Simulacrum:symbol-fmt-macros branch from f99f465 to 45df52f Jun 9, 2019

@estebank

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 10, 2019

📌 Commit 45df52f has been approved by estebank

Centril added a commit to Centril/rust that referenced this pull request Jun 12, 2019

Rollup merge of rust-lang#61568 - Mark-Simulacrum:symbol-fmt-macros, …
…r=estebank

Use Symbol, Span in libfmt_macros

I'm not super happy with this, personally, but I think it might be a decent start -- happy to take suggestions as to how to expand this or change things further.

r? @estebank

Fixes rust-lang#60795

bors added a commit that referenced this pull request Jun 12, 2019

Auto merge of #61758 - Centril:rollup-ew2uxng, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #60187 (Generator optimization: Overlap locals that never have storage live at the same time)
 - #61348 (Implement Clone::clone_from for Option and Result)
 - #61568 (Use Symbol, Span in libfmt_macros)
 - #61632 (ci: Collect CPU usage statistics on Azure)
 - #61654 (use pattern matching for slices destructuring)
 - #61671 (implement nth_back for Range(Inclusive))
 - #61688 (is_fp and is_floating_point do the same thing, remove the former)
 - #61705 (Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS)
 - #61734 (Migrate rust-by-example to MdBook2)

Failed merges:

r? @ghost

@bors bors merged commit 45df52f into rust-lang:master Jun 12, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.