rust/src/test
Pietro Albini f13d16621e
Rollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomez
rustdoc: properly calculate spans for intra-doc link resolution errors

Fixes https://github.com/rust-lang/rust/issues/55723

When rustdoc is reporting a resolution error for intra-doc links, it needs to convert a span from one relative to the *markdown* (as the links are only found on the final markdown text) to one relative to the *source code* (as the error reporting is meant to show where the line is in the source, so the user can fix it). However, a calculation for how much "offset" to apply had a subtle error: it trimmed the whole line when attempting to account for leading indentation. This caused it to add in *trailing* whitespace into this calculation, which created an incorrect span.

In a lot of situations, this isn't a problem - the span will be shifted in the code slightly, but the warning will still be displayed and mostly legible. However, there is one important situation where this can cause an ICE: multi-byte codepoints. If a shifted span now has a starting point in the middle of a multi-byte codepoint, libsyntax will panic when trying to track what source item it corresponds to. This flew under our radar because trailing whitespace and multi-byte codepoints are both situations that we don't run into in the compiler repo.

(There is one more situation where this can error, that will be much harder to fix: block-style doc comments. Lines in a block-style doc comment have a zero-or-more (usually one) character offset per line, causing this calculation to be way off. I'm punting that to another issue, though...)
2018-11-19 22:06:22 +08:00
..
auxiliary
codegen Remove extern and some return value as an attempt to make the test pass on more platforms 2018-11-14 18:09:54 +01:00
codegen-units More mono items are generated now 2018-10-25 16:47:35 +02:00
compile-fail Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakis 2018-11-15 09:51:53 +00:00
compile-fail-fulldeps Update TypedArena tests 2018-10-19 14:34:44 +02:00
debuginfo Update lldb 2018-11-06 11:46:25 -07:00
incremental Fix tests and assertions; add some comments 2018-10-26 09:50:51 +13:00
incremental-fulldeps Ignore new test on Windows 2018-09-21 10:05:23 -07:00
mir-opt Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obk 2018-11-15 01:12:01 +00:00
pretty abolish ICE when pretty-printing async block 2018-10-02 23:02:51 -07:00
run-fail Fix two run-fail tests for asmjs 2018-11-04 18:50:57 +01:00
run-fail-fulldeps
run-make Auto merge of #53996 - sekineh:thumb-run, r=japaric 2018-11-06 18:58:31 +00:00
run-make-fulldeps Correct alignment of atomic types and (re)add Atomic{I,U}128 2018-10-27 13:47:11 +03:00
run-pass Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakis 2018-11-15 09:51:53 +00:00
run-pass-fulldeps Rollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton 2018-11-18 23:24:32 +01:00
run-pass-valgrind Remove license headers from unsized-locals tests. 2018-10-24 23:27:17 +09:00
rustdoc Auto merge of #55912 - kennytm:rollup, r=kennytm 2018-11-13 22:17:46 +00:00
rustdoc-js Remove outdated rustdoc PinBox tests 2018-09-18 01:42:27 -07:00
rustdoc-ui properly calculate spans for intra-doc link resolution errors 2018-11-14 18:14:31 -06:00
rustfix
ui Rollup merge of #55923 - Zeegomo:master, r=estebank 2018-11-18 23:24:43 +01:00
ui-fulldeps Feature gate extern prelude additions from extern crate items 2018-10-24 00:14:50 +03:00
COMPILER_TESTS.md