Use generator own DefId
This commit is contained in:
parent
0d7ae7bd6f
commit
8abe4365f3
2 changed files with 8 additions and 1 deletions
|
@ -234,7 +234,7 @@ fn lint_for_missing_headers<'a, 'tcx>(
|
||||||
if implements_trait(cx, ret_ty, future, &[]);
|
if implements_trait(cx, ret_ty, future, &[]);
|
||||||
if let ty::Opaque(_, subs) = ret_ty.kind;
|
if let ty::Opaque(_, subs) = ret_ty.kind;
|
||||||
if let Some(gen) = subs.types().next();
|
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);
|
if match_type(cx, subs.as_generator().return_ty(def_id, cx.tcx), &paths::RESULT);
|
||||||
then {
|
then {
|
||||||
span_lint(
|
span_lint(
|
||||||
|
|
7
tests/ui/crashes/ice-5207.rs
Normal file
7
tests/ui/crashes/ice-5207.rs
Normal file
|
@ -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() {}
|
Loading…
Add table
Add a link
Reference in a new issue