Recurse into function bodies, but don't typeck closures
Previously, rustdoc would issue a delay_span_bug ICE on the following code:
```rust
pub fn a() -> impl Fn() -> u32 {
|| content::doesnt::matter()
}
```
This wasn't picked up earlier because having `type Alias = impl Trait;`
in the same module caused _all closures_ to be typechecked, even if they
wouldn't normally. Additionally, if _any_ error was emitted, no
delay_span_bug would be emitted. So as part of this commit all of the
tests were separated out into different files.
This commit is contained in:
10
src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs
Normal file
10
src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait ValidTrait {}
|
||||
type ImplTrait = impl ValidTrait;
|
||||
|
||||
/// This returns impl trait, but using a type alias
|
||||
pub fn h() -> ImplTrait {
|
||||
error::_in::impl_trait::alias()
|
||||
//~^ ERROR failed to resolve
|
||||
}
|
||||
Reference in New Issue
Block a user