Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generator own DefId #5213

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ fn lint_for_missing_headers<'a, 'tcx>(
if implements_trait(cx, ret_ty, future, &[]);
if let ty::Opaque(_, subs) = ret_ty.kind;
if let Some(gen) = subs.types().next();
if let ty::Generator(_, subs, _) = gen.kind;
if let ty::Generator(def_id, subs, _) = gen.kind;
if match_type(cx, subs.as_generator().return_ty(def_id, cx.tcx), &paths::RESULT);
then {
span_lint(
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/crashes/ice-5207.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// edition:2018
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commpiletest-rs has an edition flag now? s/compile-flags:\s*--edition[=\s]+2018/edition: 2018/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's space-sensitive, so it should be edition:2018, not edition: 2018 :S


// Regression test for https://github.com/rust-lang/rust-clippy/issues/5207

pub async fn bar<'a, T: 'a>(_: T) {}

fn main() {}