@@ -11,9 +11,9 @@ pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str
1111
1212 match open_files ( lint_name) {
1313 Ok ( ( mut test_file, mut lint_file) ) => {
14- let ( pass_type, pass_import, context_import) = match pass {
15- "early" => ( "EarlyLintPass" , "use syntax::ast::*;" , "EarlyContext" ) ,
16- "late" => ( "LateLintPass" , "use rustc_hir::*;" , "LateContext" ) ,
14+ let ( pass_type, pass_lifetimes , pass_import, context_import) = match pass {
15+ "early" => ( "EarlyLintPass" , "" , " use syntax::ast::*;", "EarlyContext" ) ,
16+ "late" => ( "LateLintPass" , "<'_, '_>" , " use rustc_hir::*;", "LateContext" ) ,
1717 _ => {
1818 unreachable ! ( "`pass_type` should only ever be `early` or `late`!" ) ;
1919 } ,
@@ -31,6 +31,7 @@ pub fn create(pass: Option<&str>, lint_name: Option<&str>, category: Option<&str
3131 if let Err ( e) = lint_file. write_all (
3232 get_lint_file_contents (
3333 pass_type,
34+ pass_lifetimes,
3435 lint_name,
3536 & camel_case_name,
3637 category,
@@ -125,14 +126,15 @@ fn main() {{
125126
126127fn get_lint_file_contents (
127128 pass_type : & str ,
129+ pass_lifetimes : & str ,
128130 lint_name : & str ,
129131 camel_case_name : & str ,
130132 category : & str ,
131133 pass_import : & str ,
132134 context_import : & str ,
133135) -> String {
134136 format ! (
135- "use rustc::lint ::{{LintArray, LintPass, {type}, {context_import}}};
137+ "use rustc_lint ::{{LintArray, LintPass, {type}, {context_import}}};
136138use rustc_session::{{declare_lint_pass, declare_tool_lint}};
137139{pass_import}
138140
@@ -155,9 +157,10 @@ declare_clippy_lint! {{
155157
156158declare_lint_pass!({name_camel} => [{name_upper}]);
157159
158- impl {type} for {name_camel} {{}}
160+ impl {type}{lifetimes} for {name_camel} {{}}
159161" ,
160162 type =pass_type,
163+ lifetimes=pass_lifetimes,
161164 name_upper=lint_name. to_uppercase( ) ,
162165 name_camel=camel_case_name,
163166 category=category,
0 commit comments