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

Greatly improve rustdoc xpath checks #89676

Conversation

GuillaumeGomez
Copy link
Member

Before that, we were using the XML parser from the python standard library which was... pretty limited and very nice on invalid XPaths while preventing to use nice features like //*[text()="whatever"]. This PR switches to parsel.

While doing this switch, I uncovered quite a lot of small bugs, one being in the HTML generated by rustdoc.

One question remains now: is it ok to ask for a new package to be installed (parsel) to run src/test/rustdoc test suite @Mark-Simulacrum ? If so, I can add a check into bootstrap and update the requirements in the CI.

r? @jyn514

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 8, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 8, 2021
@Mark-Simulacrum
Copy link
Member

One question remains now: is it ok to ask for a new package to be installed (parsel) to run src/test/rustdoc test suite @Mark-Simulacrum ? If so, I can add a check into bootstrap and update the requirements in the CI.

This isn't a simple question to answer, particularly with the fairly scarce information provided here. What specific problems are we aiming to address with this move? Is parsel the recommended/most popular/standard replacement (how was it chosen?), and how is its compatibility with other platforms (e.g., does it have any native code, or just pure python)?

Generally I think there is a fairly high cost if "just run rustdoc tests" starts adding in external dependencies that aren't already required. But evaluating that as a tradeoff against more correct parsing and similar is hard, not something I can readily do for you without knowing the pain(?) of the current selectors.

@GuillaumeGomez
Copy link
Member Author

I looked for packages supporting XPath in python. parsel is internally using lxml (which is a binding over a C library, so might be problematic on windows...). I unfortunately couldn't find any pure-python package supporting XPath, which is why I'm asking here. But maybe we should simply switch to another language (maybe rust has crates supporting XPath?). I'm not sure what's the best course of action here.

The initial problem was that the standard python lib we use is very bad (as the test fixes just showed) and way too limited.

@rust-log-analyzer

This comment has been minimized.

@klensy
Copy link
Contributor

klensy commented Oct 8, 2021

which is a binding over a C library, so might be problematic on windows...)

lxml works on Windows

@GuillaumeGomez GuillaumeGomez force-pushed the greatly-improve-rustdoc-xpath-checks branch from bf2c581 to f5336e6 Compare October 8, 2021 18:38
@GuillaumeGomez
Copy link
Member Author

I meant for the install.

@klensy
Copy link
Contributor

klensy commented Oct 8, 2021

pip install lxml works for me. It can be prebuilded binaries (or locally builded with C compiler).

@GuillaumeGomez
Copy link
Member Author

Oh cool, well then parsel will work just as fine then.

@rust-log-analyzer

This comment has been minimized.

@camelid
Copy link
Member

camelid commented Oct 8, 2021

It's surprising to me that 5 tests in src/test/rustdoc passed. They should all be giving the error that parsel isn't installed...

@GuillaumeGomez If you have time, could you see which tests passed? Maybe they are not working correctly.

@GuillaumeGomez
Copy link
Member Author

@camelid I was able to compute the list:

$ diff out2 out
1a2
> asm-foreign2.rs
63a65
> doc-cfg-target-feature.rs
95a98
> force-target-feature.rs
268a272
> issue-38219.rs
326a331
> macro-document-private-duplicate.rs
347a353
> no-run-still-checks-lints.rs
390a397
> sanitizer-option.rs
  • macro-document-private-duplicate.rs is ignored
  • asm-foreign2.rs: only runs on aarch-64
  • doc-cfg-target-feature.rs is using --test and is supposed to fail
  • force-target-feature.rs same as previous
  • issue-38219.rs is supposed to fail

So I think it's normal for them.

@jyn514
Copy link
Member

jyn514 commented Oct 8, 2021

@GuillaumeGomez the tests having broken syntax doesn't seem like a big deal to me; as long as the test is still checking what it's supposed to, it doesn't really matter if the parser is too lenient. The invalid generated HTML seems like a bigger deal. But I'm not sure a different XPATH parser is the best way to check that? Can we change tidy to be more strict instead?

@GuillaumeGomez
Copy link
Member Author

Do we have a case with higher traits in the std docs? Because that's what tidy is running on.

The main argument to switch to another xpath handler here is that the current one is too limited like I showed at the top. Which frustrated me at a few occasions where I wanted to select an item based on its text to then be able to select one of its child.

@jyn514
Copy link
Member

jyn514 commented Oct 8, 2021

👍 I missed that this allows text() = "whatever" - yes, I agree this is worth it for that alone.

@Mark-Simulacrum it sounds like you were concerned installing things is a pain - but x.py is already installing a lot of things behind the scenes, right? Is it a big deal to have it run pip install parsel as well?

@GuillaumeGomez if you could find a way to do this with lol-html or kuchiki that might be simpler as well.

@GuillaumeGomez
Copy link
Member Author

Neither kuchiki nor lol-html supports XPath selectors (already looked :3).

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum it sounds like you were concerned installing things is a pain - but x.py is already installing a lot of things behind the scenes, right? Is it a big deal to have it run pip install parsel as well?

AFAIK, we do not install anything in x.py that is a library for a different language, the only things x.py 'installs' are the rustc bootstrap binaries (and I suppose you could consider the Cargo packages we fetch to be installations too).

To some extent rustdoc has increasingly had a larger footprint in terms of "tools it wants", which is not entirely unexpected as the tests for it's HTML and JS generation are fairly different in kind from e.g. compiletest which largely has a dependency on "can run binaries" and some LLVM tools for codegen checking. I think if we were to depend on parsel, I would want to do the same as we do for the JS tools we depend on today -- suggest how to install them, but not actually install them on the users behalf.

I think the more tools and other stuff users need to install to run a test suite, the less likely they're to do so -- I would personally be quite wary of adding our first Python dependency for example outside of python's standard library.

The main argument to switch to another xpath handler here is that the current one is too limited like I showed at the top. Which frustrated me at a few occasions where I wanted to select an item based on its text to then be able to select one of its child.

It's worth noting that this seems like there is probably alternatives to switching to a different library here. For example, it seems plausible that we can expand ourselves upon the baseline support offered by Python's standard library and add in other XPath selectors (e.g., for text-based matching). It looks like upstream already somewhat supports the particular thing noted since 3.7 with the [.='text'] selector, though it isn't a partial matcher. Requiring a somewhat recent Python version seems preferable to a library to me.

I think it's worth making sure there's @rust-lang/rustdoc discussion of the addition of new external dependencies, particularly ones not facilitated by Cargo (i.e., trivial for most people in the rust-lang/rust tree to get).

I'll also note that both kuchiki and lol-html look like they support CSS-based selectors, which as far as I can tell are often sufficient, though seem to be a little less powerful. We could support both CSS and XPath selectors, in theory, and/or migrate to CSS selectors. My guess is that developers are more likely to quickly understand a CSS selector, fwiw.

@camelid
Copy link
Member

camelid commented Oct 8, 2021

I'll also note that both kuchiki and lol-html look like they support CSS-based selectors, which as far as I can tell are often sufficient, though seem to be a little less powerful. We could support both CSS and XPath selectors, in theory, and/or migrate to CSS selectors. My guess is that developers are more likely to quickly understand a CSS selector, fwiw.

I agree that CSS selectors are easier to understand, but IIUC, they are much more limited in what they can express than XPath.

At some point, I would like to try a system where you use XPath or CSS selectors to select a section of the DOM and then have it automatically written to a file, kind of like with UI test stderr. Then you could write tests like this:

// @select decl 'foo/fn.bar.html' 'pre.rust'
fn bar() -> i32 { 123 }

And then have a foo.decl.html generated that looks like this:

<pre class="rust ...">
  fn bar() -> <a href="...">i32</a>
</pre>

This would allow auto-blessing of tests, making it easier to change rustdoc's UI; and it would enable testing the order of DOM nodes, which would make writing tests for things like #89098 (comment) much easier, even if we used a more advanced XPath library. Also, I think we could do this with the existing Python library, since we'd be less reliant on fancy XPath syntax.

@Manishearth
Copy link
Member

I wonder if we can use a pure rust library for this and integrate this into compiletest?

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 9, 2021

I wonder if we can use a pure rust library for this and integrate this into compiletest?

I suggested it and @jyn514 did as well. Unfortunately I don't know of any and developing such a pure rust library would take a lot of time.

@Mark-Simulacrum: CSS selectors aren't easier to read (but I guess it's just a matter of point of view...), however XPaths allow more things.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 9, 2021
…ound-html-gen, r=notriddle

Fix invalid HTML generation for higher bounds

Considering this is a bug, I cherry-picked the commit from rust-lang#89676 so it's merged more quickly.

r? `@notriddle`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 9, 2021
…ound-html-gen, r=notriddle

Fix invalid HTML generation for higher bounds

Considering this is a bug, I cherry-picked the commit from rust-lang#89676 so it's merged more quickly.

r? ``@notriddle``
@Manishearth
Copy link
Member

The sxd-xpath crate exists.

@GuillaumeGomez
Copy link
Member Author

Oh nice! I'll take a look at it in the next days then.

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2021
@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 11, 2021

Just tested xsd-path: it can only work with XML apparently, so not a viable option. In case you want to push the testing further, here is the diff:

$ git diff
diff --git a/Cargo.lock b/Cargo.lock
index e45926f832c..6633d667dce 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2506,6 +2506,12 @@ version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
 
+[[package]]
+name = "peresil"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f658886ed52e196e850cfbbfddab9eaa7f6d90dd0929e264c31e5cec07e09e57"
+
 [[package]]
 name = "perf-event-open-sys"
 version = "1.0.1"
@@ -4590,6 +4596,19 @@ dependencies = [
  "serde_json",
 ]
 
+[[package]]
+name = "rustdoc-test"
+version = "0.1.0"
+dependencies = [
+ "fs-err",
+ "getopts",
+ "once_cell",
+ "regex",
+ "shlex",
+ "sxd-document",
+ "sxd-xpath",
+]
+
 [[package]]
 name = "rustdoc-themes"
 version = "0.1.0"
@@ -5078,6 +5097,27 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "sxd-document"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94d82f37be9faf1b10a82c4bd492b74f698e40082f0f40de38ab275f31d42078"
+dependencies = [
+ "peresil",
+ "typed-arena",
+]
+
+[[package]]
+name = "sxd-xpath"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "36e39da5d30887b5690e29de4c5ebb8ddff64ebd9933f98a01daaa4fd11b36ea"
+dependencies = [
+ "peresil",
+ "quick-error 1.2.3",
+ "sxd-document",
+]
+
 [[package]]
 name = "syn"
 version = "1.0.65"
@@ -5457,6 +5497,12 @@ dependencies = [
  "tracing-subscriber",
 ]
 
+[[package]]
+name = "typed-arena"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"
+
 [[package]]
 name = "typenum"
 version = "1.12.0"
diff --git a/Cargo.toml b/Cargo.toml
index 42dd5d7ef43..6583375600b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,6 +37,7 @@ members = [
   "src/tools/html-checker",
   "src/tools/bump-stage0",
   "src/tools/lld-wrapper",
+  "src/tools/rustdoc-test",
 ]
 
 exclude = [
diff --git a/library/backtrace b/library/backtrace
--- a/library/backtrace
+++ b/library/backtrace
@@ -1 +1 @@
-Subproject commit cc89bb66f91b2b4a640b0b525ca5d753e3346d7e
+Subproject commit cc89bb66f91b2b4a640b0b525ca5d753e3346d7e-dirty
diff --git a/library/stdarch b/library/stdarch
--- a/library/stdarch
+++ b/library/stdarch
@@ -1 +1 @@
-Subproject commit 5fdbc476afc81a789806697fc4a2d9d19b8c9993
+Subproject commit 5fdbc476afc81a789806697fc4a2d9d19b8c9993-dirty
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 8594fa42266..a646e5dd5f4 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1294,6 +1294,12 @@ fn run(self, builder: &Builder<'_>) {
             cmd.arg("--jsondocck-path")
                 .arg(builder.ensure(tool::JsonDocCk { compiler: json_compiler, target }));
         }
+        if mode == "rustdoc" {
+         // Use the beta compiler for rustdoc-test
+            let rustdoc_test_compiler = compiler.with_stage(0);
+            cmd.arg("--rustdoc-test-path")
+                .arg(builder.ensure(tool::RustdocTest { compiler: rustdoc_test_compiler, target }));
+        }
 
         if mode == "run-make" && suite.ends_with("fulldeps") {
             let rust_demangler = builder
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index af6f4bb0e5f..97e9dad0b12 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -376,6 +376,7 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
     ExpandYamlAnchors, "src/tools/expand-yaml-anchors", "expand-yaml-anchors";
     LintDocs, "src/tools/lint-docs", "lint-docs";
     JsonDocCk, "src/tools/jsondocck", "jsondocck";
+    RustdocTest, "src/tools/rustdoc-test", "rustdoc-test";
     HtmlChecker, "src/tools/html-checker", "html-checker";
     BumpStage0, "src/tools/bump-stage0", "bump-stage0";
 );
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
index cd0a56d08d8..029f23f0057 100644
--- a/src/tools/compiletest/src/common.rs
+++ b/src/tools/compiletest/src/common.rs
@@ -207,6 +207,9 @@ pub struct Config {
     /// The jsondocck executable.
     pub jsondocck_path: Option<String>,
 
+    /// The rustdoc-test executable.
+    pub rustdoc_test_path: Option<String>,
+
     /// The LLVM `FileCheck` binary path.
     pub llvm_filecheck: Option<PathBuf>,
 
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 87aba8c5d32..07aa2b4ecb1 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -64,6 +64,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
         .reqopt("", "lldb-python", "path to python to use for doc tests", "PATH")
         .reqopt("", "docck-python", "path to python to use for doc tests", "PATH")
         .optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
+        .optopt("", "rustdoc-test-path", "path to rustdoc-test to use for rustdoc tests", "PATH")
         .optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
         .optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
         .optopt("", "run-clang-based-tests-with", "path to Clang executable", "PATH")
@@ -223,6 +224,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
         lldb_python: matches.opt_str("lldb-python").unwrap(),
         docck_python: matches.opt_str("docck-python").unwrap(),
         jsondocck_path: matches.opt_str("jsondocck-path"),
+        rustdoc_test_path: matches.opt_str("rustdoc-test-path"),
         valgrind_path: matches.opt_str("valgrind-path"),
         force_valgrind: matches.opt_present("force-valgrind"),
         run_clang_based_tests_with: matches.opt_str("run-clang-based-tests-with"),
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 4470272a9f8..e75850466f1 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2220,11 +2220,18 @@ fn run_rustdoc_test(&self) {
             self.check_rustdoc_test_option(proc_res);
         } else {
             let root = self.config.find_rust_src_root().unwrap();
+            // let res = self.cmd2procres(
+            //     Command::new(&self.config.docck_python)
+            //         .arg(root.join("src/etc/htmldocck.py"))
+            //         .arg(&out_dir)
+            //         .arg(&self.testpaths.file),
+            // );
             let res = self.cmd2procres(
-                Command::new(&self.config.docck_python)
-                    .arg(root.join("src/etc/htmldocck.py"))
-                    .arg(&out_dir)
-                    .arg(&self.testpaths.file),
+            Command::new(self.config.rustdoc_test_path.as_ref().unwrap())
+                .arg("--doc-dir")
+                .arg(root.join(&out_dir))
+                .arg("--template")
+                .arg(&self.testpaths.file),
             );
             if !res.status.success() {
                 self.fatal_proc_rec_with_ctx("htmldocck failed!", &res, |mut this| {

And the error I got from sxd-path:

Check failed: XML parsing error at 0: {Expected("<?xml"), ExpectedComment, ExpectedElement, ExpectedProcessingInstruction, ExpectedWhitespace}

EDIT: And of course, because I'm very stupid sometimes, I forgot to add the files into git so the diff doesn't display them and I removed them before realizing my mistake... So just in case you want to try your luck from what I did, I copied the jsondocck tool and updated it (because most of its content is exactly doing the same). Here is the only file I still had in cache, cache.rs:

use crate::error::CkError;
use sxd_document::Package;
use sxd_document::dom::Document;
use std::collections::HashMap;
use std::io;
use std::path::{Path, PathBuf};

use fs_err as fs;

#[derive(Debug)]
pub struct Cache {
    root: PathBuf,
    files: HashMap<PathBuf, String>,
    values: HashMap<PathBuf, Package>,
    last_path: Option<PathBuf>,
}

impl Cache {
    /// Create a new cache, used to read files only once and otherwise store their contents.
    pub fn new(doc_dir: &str) -> Cache {
        Cache {
            root: Path::new(doc_dir).to_owned(),
            files: HashMap::new(),
            values: HashMap::new(),
            last_path: None,
        }
    }

    fn resolve_path(&mut self, path: &str) -> PathBuf {
        if path != "-" {
            let resolve = self.root.join(path);
            self.last_path = Some(resolve.clone());
            resolve
        } else {
            self.last_path
                .as_ref()
                // FIXME: Point to a line number
                .expect("No last path set. Make sure to specify a full path before using `-`")
                .clone()
        }
    }

    fn read_file(&mut self, path: &PathBuf) -> Result<String, io::Error> {
        if let Some(f) = self.files.get(path) {
            return Ok(f.clone());
        }
        let file = fs::read_to_string(path)?;

        self.files.insert(path.clone(), file.clone());

        Ok(file)
    }

    /// Get the text from a file. If called multiple times, the file will only be read once
    pub fn get_file(&mut self, path: &str) -> Result<String, io::Error> {
        let path = self.resolve_path(path);
        self.read_file(&path)
    }

    /// Parse the DOM from a file. If called multiple times, the file will only be read once.
    pub fn get_value<T, F: Fn(Document<'_>) -> T>(&mut self, path: &str, f: F) -> Result<T, CkError> {
        let rpath = self.resolve_path(path);

        if let Some(v) = self.values.get(&rpath) {
            return Ok(f(v.as_document()));
        }

        let content = self.read_file(&rpath)?;
        let val = sxd_document::parser::parse(&content)?;

        self.values.insert(rpath, val);

        self.get_value(path, f)
    }
}

@GuillaumeGomez GuillaumeGomez added S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2021
@bors
Copy link
Contributor

bors commented Oct 20, 2021

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

@camelid
Copy link
Member

camelid commented Oct 20, 2021

@GuillaumeGomez I think something went wrong the last time you rebased — this PR includes a debuginfo commit, which doesn't seem right :)

@GuillaumeGomez
Copy link
Member Author

@camelid Behold the power of git add src! 😆

@GuillaumeGomez GuillaumeGomez force-pushed the greatly-improve-rustdoc-xpath-checks branch from 4b18e74 to e2ec807 Compare October 21, 2021 09:17
@GuillaumeGomez GuillaumeGomez force-pushed the greatly-improve-rustdoc-xpath-checks branch from e2ec807 to 44378ac Compare October 21, 2021 09:17
@GuillaumeGomez
Copy link
Member Author

Rebased and cleaned up the commit mess.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-10 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
warning: `tidy` is not installed; diffs will not be generated

running 478 tests
iFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFiFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFF 100/478
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 200/478
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 300/478
FFFFFFFFFFFFFFFFFiFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFiFFFFFFFFFFFFFFFF 400/478
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

---- [rustdoc] rustdoc/async-move-doctest.rs stdout ----


error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/async-move-doctest" "/checkout/src/test/rustdoc/async-move-doctest.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/attributes.rs stdout ----
---- [rustdoc] rustdoc/attributes.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/attributes" "/checkout/src/test/rustdoc/attributes.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/assoc-consts-version.rs stdout ----
---- [rustdoc] rustdoc/assoc-consts-version.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/assoc-consts-version" "/checkout/src/test/rustdoc/assoc-consts-version.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/assoc-consts.rs stdout ----
---- [rustdoc] rustdoc/assoc-consts.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/assoc-consts" "/checkout/src/test/rustdoc/assoc-consts.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/async-fn.rs stdout ----
---- [rustdoc] rustdoc/async-fn.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/async-fn" "/checkout/src/test/rustdoc/async-fn.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/assoc-types.rs stdout ----
---- [rustdoc] rustdoc/assoc-types.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/assoc-types" "/checkout/src/test/rustdoc/assoc-types.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/bad-codeblock-syntax.rs stdout ----
---- [rustdoc] rustdoc/bad-codeblock-syntax.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/bad-codeblock-syntax" "/checkout/src/test/rustdoc/bad-codeblock-syntax.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/auto-impl-for-trait.rs stdout ----
---- [rustdoc] rustdoc/auto-impl-for-trait.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/auto-impl-for-trait" "/checkout/src/test/rustdoc/auto-impl-for-trait.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/asm-foreign.rs stdout ----
---- [rustdoc] rustdoc/asm-foreign.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/asm-foreign" "/checkout/src/test/rustdoc/asm-foreign.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/assoc-item-cast.rs stdout ----
---- [rustdoc] rustdoc/assoc-item-cast.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/assoc-item-cast" "/checkout/src/test/rustdoc/assoc-item-cast.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/associated-consts.rs stdout ----
---- [rustdoc] rustdoc/associated-consts.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/associated-consts" "/checkout/src/test/rustdoc/associated-consts.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/all.rs stdout ----
---- [rustdoc] rustdoc/all.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/all" "/checkout/src/test/rustdoc/all.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/blanket-reexport-item.rs stdout ----
---- [rustdoc] rustdoc/blanket-reexport-item.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/blanket-reexport-item" "/checkout/src/test/rustdoc/blanket-reexport-item.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/auto-impl-primitive.rs stdout ----
---- [rustdoc] rustdoc/auto-impl-primitive.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/auto-impl-primitive" "/checkout/src/test/rustdoc/auto-impl-primitive.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/auto_aliases.rs stdout ----
---- [rustdoc] rustdoc/auto_aliases.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/auto_aliases" "/checkout/src/test/rustdoc/auto_aliases.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/auto-traits.rs stdout ----
---- [rustdoc] rustdoc/auto-traits.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/auto-traits" "/checkout/src/test/rustdoc/auto-traits.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/cap-lints.rs stdout ----
---- [rustdoc] rustdoc/cap-lints.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/cap-lints" "/checkout/src/test/rustdoc/cap-lints.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/comment-in-doctest.rs stdout ----
---- [rustdoc] rustdoc/comment-in-doctest.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/comment-in-doctest" "/checkout/src/test/rustdoc/comment-in-doctest.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/cfg-doctest.rs stdout ----
---- [rustdoc] rustdoc/cfg-doctest.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/cfg-doctest" "/checkout/src/test/rustdoc/cfg-doctest.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/check-styled-link.rs stdout ----
---- [rustdoc] rustdoc/check-styled-link.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/check-styled-link" "/checkout/src/test/rustdoc/check-styled-link.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/codeblock-title.rs stdout ----
---- [rustdoc] rustdoc/codeblock-title.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/codeblock-title" "/checkout/src/test/rustdoc/codeblock-title.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/check.rs stdout ----
---- [rustdoc] rustdoc/check.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/check" "/checkout/src/test/rustdoc/check.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/check-source-code-urls-to-def-std.rs stdout ----
---- [rustdoc] rustdoc/check-source-code-urls-to-def-std.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/check-source-code-urls-to-def-std" "/checkout/src/test/rustdoc/check-source-code-urls-to-def-std.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/const-fn.rs stdout ----
---- [rustdoc] rustdoc/const-fn.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/const-fn" "/checkout/src/test/rustdoc/const-fn.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/const-evalutation-ice.rs stdout ----
---- [rustdoc] rustdoc/const-evalutation-ice.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/const-evalutation-ice" "/checkout/src/test/rustdoc/const-evalutation-ice.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
ModuleNotFoundError: No module named 'parsel'
------------------------------------------


---- [rustdoc] rustdoc/const-doc.rs stdout ----
---- [rustdoc] rustdoc/const-doc.rs stdout ----

error: htmldocck failed!
status: exit status: 1
command: "/usr/bin/python3" "/checkout/src/etc/htmldocck.py" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc/const-doc" "/checkout/src/test/rustdoc/const-doc.rs"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/checkout/src/etc/htmldocck.py", line 113, in <module>
    from parsel import Selector
---
test result: FAILED. 5 passed; 469 failed; 4 ignored; 0 measured; 0 filtered out; finished in 42.72s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "rustdoc" "--mode" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-10/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "10.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always"


Build completed unsuccessfully in 0:16:36

@bors
Copy link
Contributor

bors commented Dec 4, 2021

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

@camelid
Copy link
Member

camelid commented Dec 10, 2021

Just noting that @snapshot tests have now landed, which should reduce the necessity of this change (or a similar one) somewhat.

@GuillaumeGomez
Copy link
Member Author

Unfortunately it doesn't. We still can't select items based on their text content. I needed that recently to count items which had a specific text but couldn't. @snapshot would fit considering it would cover a lot of HTML.

@jyn514
Copy link
Member

jyn514 commented Jan 4, 2022

I would like to not be responsible for this.

r? @camelid

@GuillaumeGomez
Copy link
Member Author

We recently encountered a new issue with the current tool with #95813 and @snapshot: it only checks the attributes, not the content itself. Meaning if you have <div data-something="a"></div>, we won't be able to check the existence of the extra whitespace in the <div> tag because we can't get the "raw" content.

We looked into it with @Urgau and the tool I picked in this PR doesn't fix this issue either so I'd need to pick a completely different one. I'll try to come back to this as soon as possible.

@camelid
Copy link
Member

camelid commented May 20, 2022

Can you explain the issue with @snapshot? It should give you the exact content of the div.

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented May 20, 2022

It doesn't keep the HTML as is, it generates it. So if you have

<div


id=1></div>

you can match it against <div id=1></div>, preventing us to detect the unwanted whitespaces.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 5, 2022
…=jsha

Add empty impl blocks if they have documentation

Fixes rust-lang#90866.

The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with rust-lang#89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc `@Mark-Simulacrum).`

It looks like this:

![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png)

cc `@jyn514`
r? `@camelid`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 6, 2022
…=jsha

Add empty impl blocks if they have documentation

Fixes rust-lang#90866.

The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with rust-lang#89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ``@Mark-Simulacrum).``

It looks like this:

![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png)

cc ``@jyn514``
r? ``@camelid``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 6, 2022
…=jsha

Add empty impl blocks if they have documentation

Fixes rust-lang#90866.

The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with rust-lang#89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ```@Mark-Simulacrum).```

It looks like this:

![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png)

cc ```@jyn514```
r? ```@camelid```
@Dylan-DPC
Copy link
Member

Closing this after a discussion with @GuillaumeGomez

@Dylan-DPC Dylan-DPC closed this Oct 18, 2022
@GuillaumeGomez GuillaumeGomez deleted the greatly-improve-rustdoc-xpath-checks branch August 19, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bikeshed Status: Awaiting a decision on trivial things. S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants