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
b3827e4f3728b77bd3e60587487ebfc3cc8d901b
rust/tests/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs

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

11 lines
250 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
Make all tests use type_alias_impl_trait feature instead of min
2021-07-26 17:01:16 -03:00
#![feature(type_alias_impl_trait)]
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 {}
type ImplTrait = impl ValidTrait;
/// This returns impl trait, but using a type alias
pub fn h() -> ImplTrait {
(|| error::_in::impl_trait::alias::nested::closure())()
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 732ms Template: 3ms
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