diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-02-21 16:24:58 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-02-21 16:24:58 +0900 |
| commit | 8abe4365f3eab021bde47ef9ffebfb573918729d (patch) | |
| tree | eb58ba6bdcb5ce1923598ace1fd3cd1509762485 | |
| parent | 0d7ae7bd6f0fef3dec4ddd0edf55f6ab3e9b9090 (diff) | |
| download | rust-8abe4365f3eab021bde47ef9ffebfb573918729d.tar.gz rust-8abe4365f3eab021bde47ef9ffebfb573918729d.zip | |
Use generator own DefId
| -rw-r--r-- | clippy_lints/src/doc.rs | 2 | ||||
| -rw-r--r-- | tests/ui/crashes/ice-5207.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index 2968daa54b4..9b8664c1320 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -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( diff --git a/tests/ui/crashes/ice-5207.rs b/tests/ui/crashes/ice-5207.rs new file mode 100644 index 00000000000..1b20c9defac --- /dev/null +++ b/tests/ui/crashes/ice-5207.rs @@ -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() {} |
