diff options
| author | bors <bors@rust-lang.org> | 2023-03-01 03:11:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-03-01 03:11:44 +0000 |
| commit | 5983a3a99ea631da9d7d1ce510a6761913f92a89 (patch) | |
| tree | 98c1d9ec880ed1e96e974171f58dfa319c8ca935 /src | |
| parent | ca1bc7f1f6487991dd6b504d1fddbc982e6b779c (diff) | |
| parent | 3abc41a45ca2784c6c36b34c97302271eb48ed24 (diff) | |
Auto merge of #108586 - matthiaskrgr:rollup-ry9u2ou, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #108297 (Exit when there are unmatched delims to avoid noisy diagnostics) - #108531 (rustdoc: Show that repeated expression arrays can be made with constant values) - #108536 (Update books) - #108550 (Remove the `capture_disjoint_fields` feature) - #108551 (Descriptive error when users try to combine RPITIT/AFIT with specialization) - #108554 (Only look for param in item's generics if it actually comes from generics) - #108555 (Fix a race in the query system) - #108558 (add missing feature in core/tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| m--------- | src/doc/book | 0 | ||||
| m--------- | src/doc/reference | 0 | ||||
| m--------- | src/doc/rust-by-example | 0 | ||||
| m--------- | src/doc/rustc-dev-guide | 0 | ||||
| -rw-r--r-- | src/librustdoc/doctest.rs | 14 |
5 files changed, 3 insertions, 11 deletions
diff --git a/src/doc/book b/src/doc/book -Subproject d94e03a18a2590ed3f1c67b859cb11528d2a2d5 +Subproject 21a2ed14f4480dab62438dcc1130291bebc6537 diff --git a/src/doc/reference b/src/doc/reference -Subproject e5adb99c04817b7fbe08f4ffce5b36702667345 +Subproject a9afb04b47a84a6753e4dc657348c324c876102 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example -Subproject efe23c4fe12e06351b8dc8c3d18312c76145510 +Subproject af0998b7473839ca75563ba3d3e7fd0160bef23 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide -Subproject 41a96ab971cb45e2a184df20619ad1829765c99 +Subproject b06dab84083390e0ee1e998f466545a8a1a76a9 diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 8a73d25d3f0..9cf84acc79f 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -769,8 +769,8 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool { match maybe_new_parser_from_source_str(&sess, filename, source.to_owned()) { Ok(p) => p, Err(_) => { - debug!("Cannot build a parser to check mod attr so skipping..."); - return true; + // If there is an unclosed delimiter, an error will be returned by the tokentrees. + return false; } }; // If a parsing error happened, it's very likely that the attribute is incomplete. @@ -778,15 +778,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool { e.cancel(); return false; } - // We now check if there is an unclosed delimiter for the attribute. To do so, we look at - // the `unclosed_delims` and see if the opening square bracket was closed. - parser - .unclosed_delims() - .get(0) - .map(|unclosed| { - unclosed.unclosed_span.map(|s| s.lo()).unwrap_or(BytePos(0)) != BytePos(2) - }) - .unwrap_or(true) + true }) }) .unwrap_or(false) |
