Skip to content

Commit

Permalink
Auto merge of #5213 - JohnTitor:warm-return-ty, r=flip1995
Browse files Browse the repository at this point in the history
Use generator own DefId

Fixes #5207

changelog: Fix ICE in `missing_errors_doc`
  • Loading branch information
bors committed Feb 21, 2020
2 parents 3fc2419 + 8abe436 commit 8fbb23f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

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

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

fn main() {}

0 comments on commit 8fbb23f

Please sign in to comment.