-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #90349 - willcrichton:example-analyzer, r=jyn514
Fix rare ICE during typeck in rustdoc scrape_examples While testing the `--scrape-examples` extension on the [wasmtime](https://github.com/bytecodealliance/wasmtime) repository, I found some additional edge cases. Specifically, when asking to typecheck a body containing a function call, I would sometimes get an ICE if: * The body doesn't exist * The function's HIR node didn't have a type This adds checks for both of those conditions. (Also this updates a test to check that the sources of a reverse-dependency are correctly generated and linked.) r? `@jyn514`
- Loading branch information
Showing
5 changed files
with
28 additions
and
2 deletions.
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-invalid-expr/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 |
2 changes: 2 additions & 0 deletions
2
src/test/run-make/rustdoc-scrape-examples-invalid-expr/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,2 @@ | ||
pub struct Foo([usize; foobar::f()]); | ||
fn main() {} |
1 change: 1 addition & 0 deletions
1
src/test/run-make/rustdoc-scrape-examples-invalid-expr/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 @@ | ||
pub const fn f() -> usize { 5 } |
2 changes: 2 additions & 0 deletions
2
src/test/run-make/rustdoc-scrape-examples-multiple/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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// @has foobar/fn.ok.html '//*[@class="docblock scraped-example-list"]//*[@class="prev"]' '' | ||
// @has foobar/fn.ok.html '//*[@class="more-scraped-examples"]' '' | ||
// @has src/ex/ex.rs.html | ||
// @has foobar/fn.ok.html '//a[@href="../src/ex/ex.rs.html#2"]' '' | ||
|
||
pub fn ok() {} |