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

fix intra-link resolution spans in block comments #56010

Merged
merged 1 commit into from Dec 12, 2018

Conversation

Projects
None yet
7 participants
@euclio
Contributor

euclio commented Nov 16, 2018

This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes #55964.

r? @QuietMisdreavus

@QuietMisdreavus

This is brilliant, thank you so much! I was expecting the fix to be more complicated than this, but your PR is great!

@QuietMisdreavus

This comment has been minimized.

Member

QuietMisdreavus commented Nov 16, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Nov 16, 2018

📌 Commit 9893407 has been approved by QuietMisdreavus

bors added a commit that referenced this pull request Nov 17, 2018

Auto merge of #56026 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #55564 (test/linkage-visibility: Ignore on musl targets)
 - #55672 (miri: accept extern types in structs if they are the only field)
 - #55767 (Disable some pretty-printers when gdb is rust-enabled)
 - #55827 (A few tweaks to iterations/collecting)
 - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI)
 - #55857 (remove unused dependency)
 - #55867 (do not panic just because cargo failed)
 - #55916 (Make miri value visitor usfeful for mutation)
 - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code)
 - #55949 (ty: return impl Iterator from Predicate::walk_tys)
 - #55953 (#53488 Refactoring UpvarId)
 - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors)
 - #55963 (Stress test for MPSC)
 - #55999 (Update Cargo submodule)
 - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.)
 - #56012 (avoid shared ref in UnsafeCell::get)
 - #56017 (std: Add debugging for a failing test on appveyor)

Failed merges:

 - #56010 (fix intra-link resolution spans in block comments)

r? @ghost
@bors

This comment has been minimized.

Contributor

bors commented Nov 19, 2018

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

@euclio euclio force-pushed the euclio:intra-doc-spans branch from 9893407 to ea5843c Nov 19, 2018

@euclio

This comment has been minimized.

Contributor

euclio commented Nov 19, 2018

@QuietMisdreavus Rebased.

@euclio

This comment has been minimized.

Contributor

euclio commented Nov 26, 2018

@QuietMisdreavus

This comment has been minimized.

Member

QuietMisdreavus commented Dec 3, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Dec 3, 2018

📌 Commit ea5843c has been approved by QuietMisdreavus

kennytm added a commit to GuillaumeGomez/rust that referenced this pull request Dec 5, 2018

Rollup merge of rust-lang#56010 - euclio:intra-doc-spans, r=QuietMisd…
…reavus

fix intra-link resolution spans in block comments

This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes rust-lang#55964.

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

Auto merge of #56531 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 19 pull requests

Successful merges:

 - #51753 (Document `From` implementations)
 - #55563 (Improve no result found sentence in doc search)
 - #55987 (Add Weak.ptr_eq)
 - #56010 (fix intra-link resolution spans in block comments)
 - #56119 (Utilize `?` instead of `return None`.)
 - #56250 (Introduce ptr::hash for references)
 - #56332 ([rustdoc] Specific crate search)
 - #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
 - #56388 (More MIR borrow check cleanup)
 - #56424 (Mention raw-ident syntax)
 - #56441 (rustbuild: Fix issues with compiler docs)
 - #56452 (Remove redundant clones)
 - #56456 (Handle existential types in dead code analysis)
 - #56466 (data_structures: remove tuple_slice)
 - #56476 (Fix invalid line number match)
 - #56497 (cleanup: remove static lifetimes from consts in libstd)
 - #56498 (Fix line numbers display)
 - #56523 (Added a bare-bones eslint config (removing jslint))
 - #56525 (Avoid extra copy and syscall in std::env::current_exe)

@euclio euclio force-pushed the euclio:intra-doc-spans branch from ea5843c to 5ba7a0e Dec 6, 2018

@euclio

This comment has been minimized.

Contributor

euclio commented Dec 6, 2018

@QuietMisdreavus Added a test and made sure the compiler docs can be generated successfully. I think this solution is cleaner than the original, too!

fix intra-link resolution spans in block comments
This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes #55964.

@euclio euclio force-pushed the euclio:intra-doc-spans branch from eb32c33 to 56413ec Dec 11, 2018

@euclio euclio changed the title from [WIP] fix intra-link resolution spans in block comments to fix intra-link resolution spans in block comments Dec 11, 2018

@euclio

This comment has been minimized.

Contributor

euclio commented Dec 11, 2018

@QuietMisdreavus Ok, I think this is ready for bors to have another whack at it.

@QuietMisdreavus

This comment has been minimized.

Member

QuietMisdreavus commented Dec 11, 2018

Curious about what caused that error in the first place, but if we can get around it, that's probably best for now. The new code looks good, so here goes...

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

📌 Commit 56413ec has been approved by QuietMisdreavus

@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

⌛️ Testing commit 56413ec with merge c4b3fc4...

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

Auto merge of #56010 - euclio:intra-doc-spans, r=QuietMisdreavus
fix intra-link resolution spans in block comments

This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes #55964.

r? @QuietMisdreavus
@bors

This comment has been minimized.

Contributor

bors commented Dec 11, 2018

💔 Test failed - status-appveyor

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 11, 2018

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.
Checking out files: 100% (17616/17616), done.
travis_time:end:3a0fcb18:start=1544571021577328000,finish=1544571032075818000,duration=10498490000
$ cd rust-lang/rust
$ git checkout -qf c4b3fc4bc2f0f9e068c9bf5b6bba2f0f240fd7d0
fatal: reference is not a tree: c4b3fc4bc2f0f9e068c9bf5b6bba2f0f240fd7d0
The command "git checkout -qf c4b3fc4bc2f0f9e068c9bf5b6bba2f0f240fd7d0" failed and exited with 128 during .
Your build has been stopped.

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)

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Dec 11, 2018

@bors: retry

  • CI automation hiccup
@bors

This comment has been minimized.

Contributor

bors commented Dec 12, 2018

⌛️ Testing commit 56413ec with merge 6375777...

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

Auto merge of #56010 - euclio:intra-doc-spans, r=QuietMisdreavus
fix intra-link resolution spans in block comments

This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes #55964.

r? @QuietMisdreavus
@bors

This comment has been minimized.

Contributor

bors commented Dec 12, 2018

💔 Test failed - status-appveyor

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Dec 12, 2018

@bors: retry

@bors

This comment has been minimized.

Contributor

bors commented Dec 12, 2018

⌛️ Testing commit 56413ec with merge a64cdec...

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

Auto merge of #56010 - euclio:intra-doc-spans, r=QuietMisdreavus
fix intra-link resolution spans in block comments

This commit improves the calculation of code spans for intra-doc
resolution failures. All sugared doc comments should now have the
correct spans, including those where the comment is longer than the
docs.

It also fixes an issue where the spans were calculated incorrectly for
certain unsugared doc comments. The diagnostic will now always use the
span of the attributes, as originally intended.

Fixes #55964.

r? @QuietMisdreavus
@bors

This comment has been minimized.

Contributor

bors commented Dec 12, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing a64cdec to master...

@bors bors merged commit 56413ec into rust-lang:master Dec 12, 2018

2 checks passed

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

@euclio euclio deleted the euclio:intra-doc-spans branch Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment