Skip to content

Commit

Permalink
Rollup merge of rust-lang#94397 - xFrednet:69838-deprecate-pre-expans…
Browse files Browse the repository at this point in the history
…ion, r=cjgillot

Document that pre-expansion lint passes are softly deprecated

The pre-expansion lint pass has been softly deprecated since rust-lang#69838. Every once in a while I see someone mention it as a possibility, only get the feedback that it's deprecated. This PR officially documents that the method is soft deprecated to have a single point of truth for it.

That's it. Have a great rest of the day 🙃

---

* See [rust#69838](rust-lang#69838)
* See [rust-clippy#5518](rust-lang/rust-clippy#5518)
  • Loading branch information
matthiaskrgr authored Feb 26, 2022
2 parents da3db4e + 2bf56b9 commit 18f9326
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_lint/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ impl LintStore {
self.early_passes.push(Box::new(pass));
}

/// Used by clippy.
/// This lint pass is softly deprecated. It misses expanded code and has caused a few
/// errors in the past. Currently, it is only used in Clippy. New implementations
/// should avoid using this interface, as it might be removed in the future.
///
/// * See [rust#69838](https://github.com/rust-lang/rust/pull/69838)
/// * See [rust-clippy#5518](https://github.com/rust-lang/rust-clippy/pull/5518)
pub fn register_pre_expansion_pass(
&mut self,
pass: impl Fn() -> EarlyLintPassObject + 'static + sync::Send + sync::Sync,
Expand Down

0 comments on commit 18f9326

Please sign in to comment.