Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
a27f3e3fd1e4d16160f8885b6b06665b5319f56c
rust/tests/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
161 B
Rust
Raw Normal View History

Fix async-std at the price of breaking half the test suite - Don't mark impl trait as an error
2020-08-03 21:13:13 -04:00
//@ check-pass
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.
2020-07-09 09:13:59 -04:00
pub trait ValidTrait {}
/// This returns impl trait
pub fn g() -> impl ValidTrait {
(|| error::_in::impl_trait::alias::nested::closure())()
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 705ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API