Commit Graph

128 Commits

Author SHA1 Message Date
Guillaume Gomez
79f3fe48b0 Add regression test for #102467 2023-09-24 14:09:38 +02:00
Guillaume Gomez
295ec09b63 Update tests for custom classes 2023-09-19 17:29:39 +02:00
Guillaume Gomez
494fdcd8ec Add new rustdoc-ui test for custom_code_classes_in_docs feature 2023-09-19 13:19:15 +02:00
Guillaume Gomez
c17abf124c Update tests for custom_code_classes_in_docs feature 2023-09-17 15:11:44 +02:00
Guillaume Gomez
7681f63cab Implement new eBNF for codeblock attributes 2023-09-15 21:32:28 +02:00
Guillaume Gomez
4ce17fa30e Add support for double quotes in markdown codeblock attributes 2023-09-15 21:32:28 +02:00
Guillaume Gomez
f5561842e3 Add tests for custom_code_classes_in_docs feature 2023-09-15 21:32:28 +02:00
Michael Howell
3df9b4d65d rustdoc: use unicode-aware checks for redundant explicit link fastpath
Fixes #115064
2023-08-21 14:25:26 -07:00
Kyle Lin
25919b09a9 Add regression test for inline doc 2023-08-18 15:31:36 +08:00
Kyle Lin
62113f6657 fix unescaped_backticks error 2023-08-18 15:31:32 +08:00
Kyle Lin
ecb26376e5 narrow down the lint trigger constraint 2023-08-18 15:19:22 +08:00
Kyle Lin
fe17ae3af6 add missing deny lint 2023-08-18 15:19:18 +08:00
Kyle Lin
0e2f2cccd7 Add check-pass tests and fix test behavior 2023-08-18 15:19:18 +08:00
Kyle Lin
5ce6cc7df3 Still resolving rustdoc resolution panicking 2023-08-18 15:19:17 +08:00
Kyle Lin
46df95817d Support Reference & ReferenceUnknown link lint 2023-08-18 15:19:16 +08:00
Kyle Lin
c7369891ba Refactor lint from rustc to rustdoc 2023-08-18 15:19:15 +08:00
Kyle Lin
e583318aa8 fix trailing whitespace 2023-08-18 15:19:12 +08:00
Kyle Lin
f1b23f29db bless test output 2023-08-18 15:19:11 +08:00
Kyle Lin
1c6b237f9e add more tests 2023-08-18 15:19:11 +08:00
Kyle Lin
65e24a57bb Fix resolution caching 2023-08-18 15:19:10 +08:00
Kyle Lin
da582a71d2 Add warn level lint redundant_explicit_links
- Currently it will panic due to the resolution's caching issue
2023-08-18 15:19:08 +08:00
Yuri Astrakhan
2c5ecf22a2 Fix windows test output. 2023-08-01 14:24:11 +02:00
Mara Bos
893bb8e1ce Fix test output. 2023-07-29 11:42:53 +02:00
Mara Bos
0e729404da Change default panic handler message format. 2023-07-29 11:42:50 +02:00
Lukas Markeffsky
637ea3f746 validate doc(masked) 2023-07-24 18:04:35 +02:00
Lukas Markeffsky
237ed1630f add tests for broken links in unused doc strings 2023-07-22 13:02:49 +02:00
bors
0646a5d1aa Auto merge of #113622 - RickleAndMortimer:issue-113184-fix, r=oli-obk
add links to query documentation for E0391

This PR adds links to https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for the rustc --explain E0391 and within the compiler error itself.

Fixes: #113184
2023-07-20 03:18:41 +00:00
Esteban Küber
8eb5843a59 On nightly, dump ICE backtraces to disk
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
2023-07-19 14:10:07 +00:00
nxya
a903ac5124 fix issue-110629-private-type-cycle-dyn test 2023-07-19 10:02:15 -04:00
nxya
e6e8892051 added links as a note 2023-07-18 09:27:35 -04:00
nxya
f92a9f6808 add links to query documentation for E0391 2023-07-18 09:27:26 -04:00
nxya
bef91ee687 added links as a note 2023-07-18 09:20:25 -04:00
nxya
c429a72db9 add links to query documentation for E0391 2023-07-18 09:20:25 -04:00
Michael Howell
1a77d9a54d rustdoc: get unnormalized link destination for suggestions
Fixes #110111

This bug, and the workaround in this commit, is closely linked to
[raphlinus/pulldown-cmark#441], getting offsets of link
components. In particular, pulldown-cmark doesn't provide the
offsets of the contents of a link.

To work around this, rustdoc parser parts of a link definition
itself.

[raphlinus/pulldown-cmark#441]: https://github.com/raphlinus/pulldown-cmark/issues/441
2023-05-26 18:38:46 -07:00
Michael Goulet
bd7e8b5ef9
Rollup merge of #111152 - lukas-code:markdown-parsers-are-hard, r=GuillaumeGomez
update `pulldown-cmark` to `0.9.3`

This PR updates `pulldown-cmark` to version `0.9.3`, which does two main things:
* Pulls in https://github.com/raphlinus/pulldown-cmark/pull/643 to fix https://github.com/rust-lang/rust/issues/111117
* Allows parsing strikethrough with single tildes, e.g. `~foo~` -> ~foo~. This matches the [GFM spec](https://github.github.com/gfm/#strikethrough-extension-).

Full changelog: https://github.com/raphlinus/pulldown-cmark/pull/646
2023-05-25 13:57:59 -07:00
Guillaume Gomez
bcdfda1b6b Add regression test for #111189 2023-05-23 15:33:43 +02:00
Lukas Markeffsky
b63cc5c307 rustdoc: add regression test for broken link due to double backticks 2023-05-22 11:35:25 +02:00
Ulrich Weigand
cac7e42b52 Fix backtrace normalization in ice-bug-report-url.rs
This test case currently fails on s390x, and probably other
platforms where the last line of a backtrace does not contain
and " at <source location>" specification.

The problem with the existing normalization lines
// normalize-stderr-test "\s*\d{1,}: .*\n" -> ""
// normalize-stderr-test "\s at .*\n" -> ""
is that \s matches all whitespace, including newlines, so the
first (but not second) of these regexes may merge multiple
lines.  Thus the output differs depending on which of these
matches on the last line of a backtrace.

As the whitespace used in backtraces is just normal space
characters, change both regexes to just match at least one
space character instead:
// normalize-stderr-test " +\d{1,}: .*\n" -> ""
// normalize-stderr-test " + at .*\n" -> ""
2023-05-11 13:59:38 +02:00
Matthias Krüger
8ec84dd523
Rollup merge of #110989 - jyn514:bug-report-url, r=WaffleLapkin
Make the BUG_REPORT_URL configurable by tools

This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy
the entire hook implementation.

I haven't changed clippy in case they want to make the change upstream instead of the subtree, but
I'm happy to do so here if the maintainers want - cc ````@rust-lang/clippy````

Fixes https://github.com/rust-lang/rust/issues/109486.
2023-05-06 13:30:04 +02:00
Urgau
a5f8dba4cd Improve check-cfg diagnostics (part 1) 2023-05-05 13:06:48 +02:00
jyn
2469afef1a Make the BUG_REPORT_URL configurable by tools
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy
the entire hook implementation.

- Switch clippy to the new hook

  This also adds a `extra_info` callback so clippy can include its own version number, which differs
  from rustc's.

- Call `install_ice_hook` in rustfmt
2023-05-01 21:44:04 -05:00
Michael Goulet
bec7193072 Don't use implied trait predicates in gather_explicit_predicates_of 2023-05-01 15:45:28 +00:00
Matthias Krüger
5dec8dff7b
Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomez
rustdoc: catch and don't blow up on impl Trait cycles

Fixes #110629

An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay:

    type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>;
    type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>;

To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-30 16:25:46 +02:00
Michael Howell
b1d08275a9 rustdoc: catch and don't blow up on impl Trait cycles
An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay:

    type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>;
    type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>;

To get it right, track every time rustdoc descends into a type alias,
so if it shows up twice, it can be write the path instead of
infinitely expanding it.
2023-04-29 16:53:02 -07:00
Matthias Krüger
4b79276e60
Rollup merge of #110981 - jyn514:rustdoc-tests, r=notriddle
Move most rustdoc-ui tests into subdirectories

This makes it easier to know where to add a new test, and makes the top-level directory less overwhelming.
2023-04-30 01:14:58 +02:00
jyn
5da288f842 move lint tests into subdirectories 2023-04-29 11:36:19 -05:00
jyn
5fa975142f Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
Lukas Markeffsky
4f15a772b3 Add rustdoc::unescaped_backtick lint 2023-04-29 13:13:25 +02:00
Matthias Krüger
8ce92daa85
Rollup merge of #110904 - fmease:rustdoc-fix-110900, r=compiler-errors
rustdoc: rebind bound vars to type-outlives predicates

Fixes #110900.
2023-04-28 07:34:03 +02:00
León Orell Valerian Liehr
34d96886d4
rustdoc: rebind bound vars to type-outlives predicates 2023-04-27 18:12:53 +02:00