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 report_in_external_macro for internal lints #67854

Merged

Conversation

afnanenayet
Copy link
Contributor

Add the option to report lints in external macros for rustc internal lints to resolve #66370

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 4, 2020
@afnanenayet afnanenayet force-pushed the afnan/report-external-macro-lints branch 2 times, most recently from a790cb7 to 8785fd2 Compare January 4, 2020 01:35
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-04T03:47:31.8170212Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-04T03:47:31.8356236Z ##[command]git config gc.auto 0
2020-01-04T03:47:31.8413609Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-04T03:47:31.8466925Z ##[command]git config --get-all http.proxy
2020-01-04T03:47:31.8580957Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67854/merge:refs/remotes/pull/67854/merge
---
2020-01-04T04:10:32.8604645Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2020-01-04T04:10:35.8953621Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2020-01-04T04:10:38.4506693Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2020-01-04T04:10:48.1918314Z    Compiling rustc_span v0.0.0 (/checkout/src/librustc_span)
2020-01-04T04:10:48.4305959Z error: Prefer FxHashSet over HashSet, it has better performance
2020-01-04T04:10:48.4306843Z     --> src/librustc_span/symbol.rs:347:9
2020-01-04T04:10:48.4307301Z      |
2020-01-04T04:10:48.4307821Z 23   | / symbols! {
2020-01-04T04:10:48.4308418Z 24   | |     // After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`,
2020-01-04T04:10:48.4309222Z 25   | |     // this should be rarely necessary though if the keywords are kept in alphabetic order.
2020-01-04T04:10:48.4309750Z 26   | |     Keywords {
2020-01-04T04:10:48.4310673Z 347  | |         HashSet,
2020-01-04T04:10:48.4311130Z      | |         ^^^^^^^
2020-01-04T04:10:48.4311568Z ...    |
2020-01-04T04:10:48.4312025Z 793  | |     }
2020-01-04T04:10:48.4312025Z 793  | |     }
2020-01-04T04:10:48.4312504Z 794  | | }
2020-01-04T04:10:48.4313008Z      | |_- in this expansion of `symbols!`
2020-01-04T04:10:48.4313400Z ...
2020-01-04T04:10:48.4313860Z 1054 |       symbols!();
2020-01-04T04:10:48.4314352Z      |       ----------- in this macro invocation
2020-01-04T04:10:48.4314754Z      |
2020-01-04T04:10:48.4315236Z      = note: `-D rustc::default-hash-types` implied by `-D warnings`
2020-01-04T04:10:48.4315705Z      = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
2020-01-04T04:10:48.4315928Z 
2020-01-04T04:10:48.4479456Z error: Prefer FxHashMap over HashMap, it has better performance
2020-01-04T04:10:48.4480506Z     --> src/librustc_span/symbol.rs:348:9
2020-01-04T04:10:48.4480917Z      |
2020-01-04T04:10:48.4481324Z 23   | / symbols! {
2020-01-04T04:10:48.4481791Z 24   | |     // After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`,
2020-01-04T04:10:48.4483226Z 25   | |     // this should be rarely necessary though if the keywords are kept in alphabetic order.
2020-01-04T04:10:48.4483860Z 26   | |     Keywords {
2020-01-04T04:10:48.4485125Z 348  | |         HashMap,
2020-01-04T04:10:48.4485613Z      | |         ^^^^^^^
2020-01-04T04:10:48.4486499Z ...    |
2020-01-04T04:10:48.4487404Z 793  | |     }
---
2020-01-04T04:10:49.8436525Z   local time: Sat Jan  4 04:10:49 UTC 2020
2020-01-04T04:10:49.8436561Z   network time: Sat, 04 Jan 2020 04:10:49 GMT
2020-01-04T04:10:49.8436635Z == end clock drift check ==
2020-01-04T04:10:50.7100571Z 
2020-01-04T04:10:50.7196582Z ##[error]Bash exited with code '1'.
2020-01-04T04:10:50.7230733Z ##[section]Starting: Checkout
2020-01-04T04:10:50.7232165Z ==============================================================================
2020-01-04T04:10:50.7232225Z Task         : Get sources
2020-01-04T04:10:50.7232262Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 4, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-05T20:39:07.7352867Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-05T20:39:07.7370267Z ##[command]git config gc.auto 0
2020-01-05T20:39:07.7375347Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-05T20:39:07.7379853Z ##[command]git config --get-all http.proxy
2020-01-05T20:39:07.7385460Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67854/merge:refs/remotes/pull/67854/merge
---
2020-01-05T21:09:43.8016330Z    Compiling rustc_data_structures v0.0.0 (/checkout/src/librustc_data_structures)
2020-01-05T21:09:48.2014841Z    Compiling arena v0.0.0 (/checkout/src/libarena)
2020-01-05T21:09:50.9994892Z    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
2020-01-05T21:10:04.3363773Z    Compiling rustc_span v0.0.0 (/checkout/src/librustc_span)
2020-01-05T21:10:04.6663005Z error: Prefer FxHashSet over HashSet, it has better performance
2020-01-05T21:10:04.6663480Z     --> src/librustc_span/symbol.rs:350:9
2020-01-05T21:10:04.6663730Z      |
2020-01-05T21:10:04.6664029Z 26   | / symbols! {
2020-01-05T21:10:04.6664488Z 27   | |     // After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`,
2020-01-05T21:10:04.6664906Z 28   | |     // this should be rarely necessary though if the keywords are kept in alphabetic order.
2020-01-05T21:10:04.6665377Z 29   | |     Keywords {
2020-01-05T21:10:04.6666200Z 350  | |         HashSet,
2020-01-05T21:10:04.6666438Z      | |         ^^^^^^^
2020-01-05T21:10:04.6666635Z ...    |
2020-01-05T21:10:04.6666887Z 796  | |     }
2020-01-05T21:10:04.6666887Z 796  | |     }
2020-01-05T21:10:04.6667138Z 797  | | }
2020-01-05T21:10:04.6667393Z      | |_- in this expansion of `symbols!`
2020-01-05T21:10:04.6667583Z ...
2020-01-05T21:10:04.6667804Z 1057 |       symbols!();
2020-01-05T21:10:04.6668072Z      |       ----------- in this macro invocation
2020-01-05T21:10:04.6668277Z      |
2020-01-05T21:10:04.6668516Z      = note: `-D rustc::default-hash-types` implied by `-D warnings`
2020-01-05T21:10:04.6668763Z      = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
2020-01-05T21:10:04.6668818Z 
2020-01-05T21:10:04.6908099Z error: Prefer FxHashMap over HashMap, it has better performance
2020-01-05T21:10:04.6908370Z     --> src/librustc_span/symbol.rs:351:9
2020-01-05T21:10:04.6908585Z      |
2020-01-05T21:10:04.6908820Z 26   | / symbols! {
2020-01-05T21:10:04.6909117Z 27   | |     // After modifying this list adjust `is_special`, `is_used_keyword`/`is_unused_keyword`,
2020-01-05T21:10:04.6909441Z 28   | |     // this should be rarely necessary though if the keywords are kept in alphabetic order.
2020-01-05T21:10:04.6909683Z 29   | |     Keywords {
2020-01-05T21:10:04.6910502Z 351  | |         HashMap,
2020-01-05T21:10:04.6910737Z      | |         ^^^^^^^
2020-01-05T21:10:04.6910951Z ...    |
2020-01-05T21:10:04.6911688Z 796  | |     }
---
2020-01-05T21:10:05.5752583Z   local time: Sun Jan  5 21:10:05 UTC 2020
2020-01-05T21:10:05.8332762Z   network time: Sun, 05 Jan 2020 21:10:05 GMT
2020-01-05T21:10:05.8333427Z == end clock drift check ==
2020-01-05T21:10:07.3582496Z 
2020-01-05T21:10:07.3690670Z ##[error]Bash exited with code '1'.
2020-01-05T21:10:07.3735558Z ##[section]Starting: Checkout
2020-01-05T21:10:07.3737730Z ==============================================================================
2020-01-05T21:10:07.3737813Z Task         : Get sources
2020-01-05T21:10:07.3737849Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@afnanenayet
Copy link
Contributor Author

@petrochenkov what's the proper way to ignore a lint for a macro? I'm not sure how attribute scoping works with macro expansion

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-06T00:08:53.7935593Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-06T00:08:53.7947705Z ##[command]git config gc.auto 0
2020-01-06T00:08:53.7950143Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-06T00:08:53.7952760Z ##[command]git config --get-all http.proxy
2020-01-06T00:08:53.7955131Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67854/merge:refs/remotes/pull/67854/merge
---
2020-01-06T00:45:55.6184290Z    Compiling rustc_lint v0.0.0 (/checkout/src/librustc_lint)
2020-01-06T00:45:55.9255064Z error: implementing `LintPass` by hand
2020-01-06T00:45:55.9256357Z    --> <::rustc::lint::declare_combined_early_lint_pass macros>:16:9
2020-01-06T00:45:55.9256858Z     |
2020-01-06T00:45:55.9257948Z 1   |   / ([$ v : vis $ name : ident, [$ ($ passes : ident : $ constructor : expr,) *]],
2020-01-06T00:45:55.9259046Z 2   |   |  $ methods : tt) =>
2020-01-06T00:45:55.9259616Z 3   |   | (# [allow (non_snake_case)] $ v struct $ name { $ ($ passes : $ passes,) * }
2020-01-06T00:45:55.9260131Z 4   |   |  impl $ name
2020-01-06T00:45:55.9260709Z ...     |
2020-01-06T00:45:55.9261362Z 16  |   |  } impl LintPass for $ name
2020-01-06T00:45:55.9262311Z     |   |         ^^^^^^^^
2020-01-06T00:45:55.9262914Z 17  |   |  { fn name (& self) -> & 'static str { panic ! () } })
2020-01-06T00:45:55.9263458Z     |   |______________________________________________________- in this expansion of `declare_combined_early_lint_pass!` (#4)
2020-01-06T00:45:55.9264155Z    ::: src/librustc_lint/lib.rs:75:1
2020-01-06T00:45:55.9264473Z     |
2020-01-06T00:45:55.9264473Z     |
2020-01-06T00:45:55.9264889Z 75  | /   macro_rules! pre_expansion_lint_passes {
2020-01-06T00:45:55.9265322Z 76  | |       ($macro:path, $args:tt) => {
2020-01-06T00:45:55.9265780Z 77  | |           $macro!($args, [KeywordIdents: KeywordIdents, UnusedDocComment: UnusedDocComment,]);
2020-01-06T00:45:55.9267250Z 78  | |       };
2020-01-06T00:45:55.9267674Z 79  | |   }
2020-01-06T00:45:55.9268117Z     | |___- in this expansion of `pre_expansion_lint_passes!` (#1)
2020-01-06T00:45:55.9268469Z ...
2020-01-06T00:45:55.9268469Z ...
2020-01-06T00:45:55.9268889Z 102 | /   macro_rules! declare_combined_early_pass {
2020-01-06T00:45:55.9269324Z 103 | |       ([$name:ident], $passes:tt) => (
2020-01-06T00:45:55.9270188Z 104 | |           early_lint_methods!(declare_combined_early_lint_pass, [pub $name, $passes]);
2020-01-06T00:45:55.9271282Z 105 | |       )
2020-01-06T00:45:55.9271675Z 106 | |   }
2020-01-06T00:45:55.9272131Z     | |___- in this expansion of `declare_combined_early_pass!` (#2)
2020-01-06T00:45:55.9272627Z 107 | 
2020-01-06T00:45:55.9272627Z 107 | 
2020-01-06T00:45:55.9273265Z 108 |     pre_expansion_lint_passes!(declare_combined_early_pass, [BuiltinCombinedPreExpansionLintPass]);
2020-01-06T00:45:55.9274450Z     | 
2020-01-06T00:45:55.9274828Z    ::: <::rustc::lint::early_lint_methods macros>:1:1
2020-01-06T00:45:55.9275178Z     |
2020-01-06T00:45:55.9275178Z     |
2020-01-06T00:45:55.9275602Z 1   |  /  ($ macro : path, $ args : tt) =>
2020-01-06T00:45:55.9276021Z 2   |  |  ($ macro !
2020-01-06T00:45:55.9276818Z 3   | ||   ($ args,
2020-01-06T00:45:55.9276818Z 3   | ||   ($ args,
2020-01-06T00:45:55.9277671Z 4   | ||    [fn check_param (a : & ast :: Param) ; fn check_ident (a : ast :: Ident) ;
2020-01-06T00:45:55.9278141Z 5   | ||     fn check_crate (a : & ast :: Crate) ; fn check_crate_post
2020-01-06T00:45:55.9278544Z ...   ||
2020-01-06T00:45:55.9279001Z 39  | ||     /// Counterpart to `enter_lint_attrs`.
2020-01-06T00:45:55.9279630Z 40  | ||      fn exit_lint_attrs (a : & [ast :: Attribute]) ;]) ;)
2020-01-06T00:45:55.9280090Z     | ||________________________________________________________-- in this expansion of `early_lint_methods!` (#3)
2020-01-06T00:45:55.9281862Z     |                                                           in this macro invocation (#4)
2020-01-06T00:45:55.9282085Z     |
2020-01-06T00:45:55.9282520Z     = note: `-D rustc::lint-pass-impl-without-macro` implied by `-D warnings`
2020-01-06T00:45:55.9282520Z     = note: `-D rustc::lint-pass-impl-without-macro` implied by `-D warnings`
2020-01-06T00:45:55.9282960Z     = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
2020-01-06T00:45:55.9416402Z error: implementing `LintPass` by hand
2020-01-06T00:45:55.9416710Z    --> <::rustc::lint::declare_combined_early_lint_pass macros>:16:9
2020-01-06T00:45:55.9416944Z     |
2020-01-06T00:45:55.9416944Z     |
2020-01-06T00:45:55.9417425Z 1   |   / ([$ v : vis $ name : ident, [$ ($ passes : ident : $ constructor : expr,) *]],
2020-01-06T00:45:55.9417783Z 2   |   |  $ methods : tt) =>
2020-01-06T00:45:55.9418632Z 3   |   | (# [allow (non_snake_case)] $ v struct $ name { $ ($ passes : $ passes,) * }
2020-01-06T00:45:55.9419002Z 4   |   |  impl $ name
2020-01-06T00:45:55.9419228Z ...     |
2020-01-06T00:45:55.9419672Z 16  |   |  } impl LintPass for $ name
2020-01-06T00:45:55.9420100Z     |   |         ^^^^^^^^
2020-01-06T00:45:55.9420592Z 17  |   |  { fn name (& self) -> & 'static str { panic ! () } })
2020-01-06T00:45:55.9420928Z     |   |______________________________________________________- in this expansion of `declare_combined_early_lint_pass!` (#4)
2020-01-06T00:45:55.9421355Z    ::: src/librustc_lint/lib.rs:81:1
2020-01-06T00:45:55.9421535Z     |
2020-01-06T00:45:55.9421535Z     |
2020-01-06T00:45:55.9421811Z 81  | /   macro_rules! early_lint_passes {
2020-01-06T00:45:55.9422082Z 82  | |       ($macro:path, $args:tt) => {
2020-01-06T00:45:55.9422334Z 83  |             $macro!(
2020-01-06T00:45:55.9422770Z 84  |                 $args,
2020-01-06T00:45:55.9423021Z 85  |                 [
2020-01-06T00:45:55.9423269Z 86  |                     UnusedParens: UnusedParens,
2020-01-06T00:45:55.9423435Z ...
2020-01-06T00:45:55.9423435Z ...
2020-01-06T00:45:55.9423665Z 97  |                 ]
2020-01-06T00:45:55.9423901Z 98  | |           );
2020-01-06T00:45:55.9424165Z     | |____________- in this macro invocation (#2)
2020-01-06T00:45:55.9424427Z 99  | |       };
2020-01-06T00:45:55.9424657Z 100 | |   }
2020-01-06T00:45:55.9424929Z     | |___- in this expansion of `early_lint_passes!` (#1)
2020-01-06T00:45:55.9425151Z 101 | 
2020-01-06T00:45:55.9425412Z 102 | /   macro_rules! declare_combined_early_pass {
2020-01-06T00:45:55.9425676Z 103 | |       ([$name:ident], $passes:tt) => (
2020-01-06T00:45:55.9426245Z 104 | |           early_lint_methods!(declare_combined_early_lint_pass, [pub $name, $passes]);
2020-01-06T00:45:55.9427200Z 105 | |       )
2020-01-06T00:45:55.9427446Z 106 | |   }
2020-01-06T00:45:55.9427757Z     | |___- in this expansion of `declare_combined_early_pass!` (#2)
2020-01-06T00:45:55.9427943Z ...
2020-01-06T00:45:55.9427943Z ...
2020-01-06T00:45:55.9428238Z 109 |     early_lint_passes!(declare_combined_early_pass, [BuiltinCombinedEarlyLintPass]);
2020-01-06T00:45:55.9428965Z     | 
2020-01-06T00:45:55.9429359Z    ::: <::rustc::lint::early_lint_methods macros>:1:1
2020-01-06T00:45:55.9429555Z     |
2020-01-06T00:45:55.9429555Z     |
2020-01-06T00:45:55.9429812Z 1   |  /  ($ macro : path, $ args : tt) =>
2020-01-06T00:45:55.9430058Z 2   |  |  ($ macro !
2020-01-06T00:45:55.9430554Z 3   | ||   ($ args,
2020-01-06T00:45:55.9430554Z 3   | ||   ($ args,
2020-01-06T00:45:55.9430884Z 4   | ||    [fn check_param (a : & ast :: Param) ; fn check_ident (a : ast :: Ident) ;
2020-01-06T00:45:55.9431200Z 5   | ||     fn check_crate (a : & ast :: Crate) ; fn check_crate_post
2020-01-06T00:45:55.9431423Z ...   ||
2020-01-06T00:45:55.9431726Z 39  | ||     /// Counterpart to `enter_lint_attrs`.
2020-01-06T00:45:55.9432018Z 40  | ||      fn exit_lint_attrs (a : & [ast :: Attribute]) ;]) ;)
2020-01-06T00:45:55.9432355Z     | ||________________________________________________________-- in this expansion of `early_lint_methods!` (#3)
2020-01-06T00:45:55.9432886Z     |                                                           in this macro invocation (#4)
2020-01-06T00:45:55.9433087Z     |
2020-01-06T00:45:55.9433087Z     |
2020-01-06T00:45:55.9433327Z     = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
2020-01-06T00:45:55.9463846Z error: implementing `LintPass` by hand
2020-01-06T00:45:55.9464230Z    --> <::rustc::lint::declare_combined_late_lint_pass macros>:14:7
2020-01-06T00:45:55.9464635Z     |
2020-01-06T00:45:55.9464635Z     |
2020-01-06T00:45:55.9464961Z 1   |   / ([$ v : vis $ name : ident, [$ ($ passes : ident : $ constructor : expr,) *]],
2020-01-06T00:45:55.9465345Z 2   |   |  [$ hir : tt], $ methods : tt) =>
2020-01-06T00:45:55.9465670Z 3   |   | (# [allow (non_snake_case)] $ v struct $ name { $ ($ passes : $ passes,) * }
2020-01-06T00:45:55.9465926Z 4   |   |  impl $ name
2020-01-06T00:45:55.9466124Z ...     |
2020-01-06T00:45:55.9466410Z 14  |   |  impl LintPass for $ name
2020-01-06T00:45:55.9466661Z     |   |       ^^^^^^^^
2020-01-06T00:45:55.9466943Z 15  |   |  { fn name (& self) -> & 'static str { panic ! () } })
2020-01-06T00:45:55.9467305Z     |   |______________________________________________________- in this expansion of `declare_combined_late_lint_pass!` (#4)
2020-01-06T00:45:55.9467714Z    ::: src/librustc_lint/lib.rs:111:1
2020-01-06T00:45:55.9467891Z     |
2020-01-06T00:45:55.9468153Z 111 | /   macro_rules! late_lint_passes {
2020-01-06T00:45:55.9468153Z 111 | /   macro_rules! late_lint_passes {
2020-01-06T00:45:55.9468435Z 112 | |       ($macro:path, $args:tt) => {
2020-01-06T00:45:55.9468665Z 113 |             $macro!(
2020-01-06T00:45:55.9469121Z 114 |                 $args,
2020-01-06T00:45:55.9469347Z 115 |                 [
2020-01-06T00:45:55.9469620Z 116 |                     // FIXME: Look into regression when this is used as a module lint
2020-01-06T00:45:55.9469815Z ...
2020-01-06T00:45:55.9469815Z ...
2020-01-06T00:45:55.9470034Z 132 |                 ]
2020-01-06T00:45:55.9470270Z 133 | |           );
2020-01-06T00:45:55.9470734Z     | |____________- in this macro invocation (#2)
2020-01-06T00:45:55.9470989Z 134 | |       };
2020-01-06T00:45:55.9471226Z 135 | |   }
2020-01-06T00:45:55.9471707Z     | |___- in this expansion of `late_lint_passes!` (#1)
2020-01-06T00:45:55.9471888Z ...
2020-01-06T00:45:55.9472654Z 170 | /   macro_rules! declare_combined_late_pass {
2020-01-06T00:45:55.9473195Z 171 | |       ([$v:vis $name:ident], $passes:tt) => (
2020-01-06T00:45:55.9473533Z 172 | |           late_lint_methods!(declare_combined_late_lint_pass, [$v $name, $passes], ['tcx]);
2020-01-06T00:45:55.9474453Z 173 | |       )
2020-01-06T00:45:55.9474715Z 174 | |   }
2020-01-06T00:45:55.9475020Z     | |___- in this expansion of `declare_combined_late_pass!` (#2)
2020-01-06T00:45:55.9475367Z ...
2020-01-06T00:45:55.9475367Z ...
2020-01-06T00:45:55.9475864Z 177 |     late_lint_passes!(declare_combined_late_pass, [pub BuiltinCombinedLateLintPass]);
2020-01-06T00:45:55.9477000Z     | 
2020-01-06T00:45:55.9477237Z    ::: <::rustc::lint::late_lint_methods macros>:1:1
2020-01-06T00:45:55.9477433Z     |
2020-01-06T00:45:55.9477433Z     |
2020-01-06T00:45:55.9477749Z 1   |  /  ($ macro : path, $ args : tt, [$ hir : tt]) =>
2020-01-06T00:45:55.9478028Z 2   |  |  ($ macro !
2020-01-06T00:45:55.9478285Z     |  |___-
2020-01-06T00:45:55.9478574Z 3   | ||   ($ args, [$ hir],
2020-01-06T00:45:55.9478923Z 4   | ||    [fn check_param (a : & $ hir hir :: Param < $ hir >) ; fn check_body
2020-01-06T00:45:55.9479278Z 5   | ||     (a : & $ hir hir :: Body < $ hir >) ; fn check_body_post
2020-01-06T00:45:55.9479683Z ...   ||
2020-01-06T00:45:55.9480015Z 51  | ||     /// Counterpart to `enter_lint_attrs`.
2020-01-06T00:45:55.9480325Z 52  | ||      fn exit_lint_attrs (a : & $ hir [ast :: Attribute]) ;]) ;)
2020-01-06T00:45:55.9480680Z     | ||______________________________________________________________-- in this expansion of `late_lint_methods!` (#3)
2020-01-06T00:45:55.9482424Z     |                                                                 in this macro invocation (#4)
2020-01-06T00:45:55.9482862Z     |
2020-01-06T00:45:55.9482862Z     |
2020-01-06T00:45:55.9483298Z     = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
2020-01-06T00:45:55.9666553Z error: implementing `LintPass` by hand
2020-01-06T00:45:55.9667011Z    --> <::rustc::lint::declare_combined_late_lint_pass macros>:14:7
2020-01-06T00:45:55.9667236Z     |
2020-01-06T00:45:55.9667236Z     |
2020-01-06T00:45:55.9667761Z 1   |   / ([$ v : vis $ name : ident, [$ ($ passes : ident : $ constructor : expr,) *]],
2020-01-06T00:45:55.9668064Z 2   |   |  [$ hir : tt], $ methods : tt) =>
2020-01-06T00:45:55.9668427Z 3   |   | (# [allow (non_snake_case)] $ v struct $ name { $ ($ passes : $ passes,) * }
2020-01-06T00:45:55.9668891Z 4   |   |  impl $ name
2020-01-06T00:45:55.9669141Z ...     |
2020-01-06T00:45:55.9669433Z 14  |   |  impl LintPass for $ name
2020-01-06T00:45:55.9669721Z     |   |       ^^^^^^^^
2020-01-06T00:45:55.9670224Z 15  |   |  { fn name (& self) -> & 'static str { panic ! () } })
2020-01-06T00:45:55.9670800Z     |   |______________________________________________________- in this expansion of `declare_combined_late_lint_pass!` (#4)
2020-01-06T00:45:55.9671260Z    ::: src/librustc_lint/lib.rs:137:1
2020-01-06T00:45:55.9671452Z     |
2020-01-06T00:45:55.9671452Z     |
2020-01-06T00:45:55.9671749Z 137 | /   macro_rules! late_lint_mod_passes {
2020-01-06T00:45:55.9672195Z 138 | |       ($macro:path, $args:tt) => {
2020-01-06T00:45:55.9672451Z 139 |             $macro!(
2020-01-06T00:45:55.9672901Z 140 |                 $args,
2020-01-06T00:45:55.9673146Z 141 |                 [
2020-01-06T00:45:55.9673146Z 141 |                 [
2020-01-06T00:45:55.9673409Z 142 |                     HardwiredLints: HardwiredLints,
2020-01-06T00:45:55.9673997Z 165 |                 ]
2020-01-06T00:45:55.9674237Z 166 | |           );
2020-01-06T00:45:55.9674505Z     | |____________- in this macro invocation (#2)
2020-01-06T00:45:55.9674764Z 167 | |       };
2020-01-06T00:45:55.9674764Z 167 | |       };
2020-01-06T00:45:55.9675171Z 168 | |   }
2020-01-06T00:45:55.9675518Z     | |___- in this expansion of `late_lint_mod_passes!` (#1)
2020-01-06T00:45:55.9675775Z 169 | 
2020-01-06T00:45:55.9676031Z 170 | /   macro_rules! declare_combined_late_pass {
2020-01-06T00:45:55.9676294Z 171 | |       ([$v:vis $name:ident], $passes:tt) => (
2020-01-06T00:45:55.9677068Z 172 | |           late_lint_methods!(declare_combined_late_lint_pass, [$v $name, $passes], ['tcx]);
2020-01-06T00:45:55.9677727Z 173 | |       )
2020-01-06T00:45:55.9677974Z 174 | |   }
2020-01-06T00:45:55.9678273Z     | |___- in this expansion of `declare_combined_late_pass!` (#2)
2020-01-06T00:45:55.9678462Z ...
2020-01-06T00:45:55.9678462Z ...
2020-01-06T00:45:55.9678749Z 179 |     late_lint_mod_passes!(declare_combined_late_pass, [BuiltinCombinedModuleLateLintPass]);
2020-01-06T00:45:55.9679305Z     | 
2020-01-06T00:45:55.9679533Z    ::: <::rustc::lint::late_lint_methods macros>:1:1
2020-01-06T00:45:55.9679736Z     |
2020-01-06T00:45:55.9679736Z     |
2020-01-06T00:45:55.9680345Z 1   |  /  ($ macro : path, $ args : tt, [$ hir : tt]) =>
2020-01-06T00:45:55.9680792Z 2   |  |  ($ macro !
2020-01-06T00:45:55.9681199Z     |  |___-
2020-01-06T00:45:55.9681469Z 3   | ||   ($ args, [$ hir],
2020-01-06T00:45:55.9682187Z 4   | ||    [fn check_param (a : & $ hir hir :: Param < $ hir >) ; fn check_body
2020-01-06T00:45:55.9682837Z 5   | ||     (a : & $ hir hir :: Body < $ hir >) ; fn check_body_post
2020-01-06T00:45:55.9683137Z ...   ||
2020-01-06T00:45:55.9683836Z 51  | ||     /// Counterpart to `enter_lint_attrs`.
2020-01-06T00:45:55.9684346Z 52  | ||      fn exit_lint_attrs (a : & $ hir [ast :: Attribute]) ;]) ;)
2020-01-06T00:45:55.9684898Z     | ||______________________________________________________________-- in this expansion of `late_lint_methods!` (#3)
2020-01-06T00:45:55.9685956Z     |                                                                 in this macro invocation (#4)
2020-01-06T00:45:55.9686396Z     |
2020-01-06T00:45:55.9686396Z     |
2020-01-06T00:45:55.9686678Z     = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
2020-01-06T00:45:57.0729456Z error: aborting due to 4 previous errors
2020-01-06T00:45:57.0732663Z 
2020-01-06T00:45:57.0824250Z error: could not compile `rustc_lint`.
2020-01-06T00:45:57.0840852Z warning: build failed, waiting for other jobs to finish...
---
2020-01-06T00:46:52.5817219Z   local time: Mon Jan  6 00:46:52 UTC 2020
2020-01-06T00:46:53.1081768Z   network time: Mon, 06 Jan 2020 00:46:53 GMT
2020-01-06T00:46:53.1085052Z == end clock drift check ==
2020-01-06T00:46:55.6282727Z 
2020-01-06T00:46:55.6378336Z ##[error]Bash exited with code '1'.
2020-01-06T00:46:55.6409925Z ##[section]Starting: Checkout
2020-01-06T00:46:55.6411368Z ==============================================================================
2020-01-06T00:46:55.6411410Z Task         : Get sources
2020-01-06T00:46:55.6411462Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

src/librustc_span/symbol.rs Outdated Show resolved Hide resolved
src/librustc_span/symbol.rs Show resolved Hide resolved
@afnanenayet afnanenayet force-pushed the afnan/report-external-macro-lints branch 3 times, most recently from e1f326b to 9f807d7 Compare January 6, 2020 15:36
@afnanenayet
Copy link
Contributor Author

I'm not using the report in external macro option for one of the lints where it explicitly goes against the purpose of the lint, as explained in this commit: 9f807d7

@afnanenayet
Copy link
Contributor Author

@petrochenkov sorry to spam you with pings, but I'm not sure how to change the label that says "waiting on author" since the tests have passed

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 8, 2020

📌 Commit 9f807d72601920bad8bc2df9a4e18c518becb8cd has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 8, 2020
@petrochenkov
Copy link
Contributor

Actually, could you squash the commits into one? r=me after that.
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 8, 2020
@bors
Copy link
Contributor

bors commented Jan 12, 2020

☔ The latest upstream changes (presumably #68142) made this pull request unmergeable. Please resolve the merge conflicts.

@afnanenayet afnanenayet force-pushed the afnan/report-external-macro-lints branch 4 times, most recently from 9f807d7 to 522a39c Compare January 13, 2020 07:19
Add the option to report lints in external macros for rustc internal
lints
@afnanenayet afnanenayet force-pushed the afnan/report-external-macro-lints branch from 522a39c to 9d95eaa Compare January 13, 2020 07:21
@afnanenayet
Copy link
Contributor Author

@bors r=@petrochenkov

@bors
Copy link
Contributor

bors commented Jan 13, 2020

@afnanenayet: 🔑 Insufficient privileges: Not in reviewers

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 13, 2020

📌 Commit 9d95eaa has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 13, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 14, 2020
…acro-lints, r=petrochenkov

Use `report_in_external_macro` for internal lints

Add the option to report lints in external macros for rustc internal lints to resolve rust-lang#66370
bors added a commit that referenced this pull request Jan 14, 2020
Rollup of 10 pull requests

Successful merges:

 - #67854 (Use `report_in_external_macro` for internal lints)
 - #67989 (rustdoc: Don't allow `#![feature(...)]` on stable or beta)
 - #68036 (libterm: parse extended terminfo format)
 - #68127 (Clarify the relationship between `extended` and `tools` in `config.toml`)
 - #68143 (Forbid elided lifetimes within const generic parameter types)
 - #68150 (Document behavior of set_nonblocking on UnixListener)
 - #68166 (rustdoc: HTML escape arrows on help popup)
 - #68176 (Clean up err codes)
 - #68179 (Remove unneeded scope)
 - #68188 (Tweak assertion note in format check)

Failed merges:

r? @ghost
@bors bors merged commit 9d95eaa into rust-lang:master Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use report_in_external_macro in internal lints
4 participants