-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #93568 - willcrichton:scrape-examples-leading-whitesp…
…ace, r=CraftSpider Include all contents of first line of scraped item in Rustdoc This fixes #93528. When scraping examples, it extends the span of the enclosing item to include all characters up to the start of the first line of the span. r? `@camelid`
- Loading branch information
Showing
4 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
deps := ex | ||
|
||
-include ../rustdoc-scrape-examples-multiple/scrape.mk | ||
|
||
all: scrape |
8 changes: 8 additions & 0 deletions
8
src/test/run-make/rustdoc-scrape-examples-whitespace/examples/ex.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
struct Foo; | ||
impl Foo { | ||
fn bar() { foobar::ok(); } | ||
} | ||
|
||
fn main() { | ||
Foo::bar(); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/test/run-make/rustdoc-scrape-examples-whitespace/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//code' ' ' | ||
|
||
pub fn ok() {} |