diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2024-12-16 01:52:23 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-16 01:52:23 +0800 |
| commit | 56545cae6938012c1a6bef9996395b6aa7222d05 (patch) | |
| tree | 6a8f51c9d5bd68d8804eec8a55bb0997c7e79402 /compiler/rustc_interface/src | |
| parent | b5602cff44997a094dce29d846f9917aaffbe75d (diff) | |
| parent | 291c519c6966bb18e13d66a4283380ced339c49f (diff) | |
| download | rust-56545cae6938012c1a6bef9996395b6aa7222d05.tar.gz rust-56545cae6938012c1a6bef9996395b6aa7222d05.zip | |
Rollup merge of #134339 - Urgau:tcx-in-early-diag, r=jieyouxu
Pass `TyCtxt` to early diagostics decoration This PR pass a `TyCtxt` to the early diagnostics decoration code so that diagnostics code that take advantage of (a very limited but still useful) `TyCtxt` in their note, help, suggestions, ... This is particulary useful for #133221 which wants to get the crate name of a `DefId`, which is possible with `tcx.crate_name(...)`. I highly recommend reviewing this PR commit by commit. r? `@jieyouxu`
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 430bc7db077..f8351a81bec 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -76,6 +76,7 @@ fn pre_expansion_lint<'a>( || { rustc_lint::check_ast_node( sess, + None, features, true, lint_store, @@ -310,6 +311,7 @@ fn early_lint_checks(tcx: TyCtxt<'_>, (): ()) { let lint_store = unerased_lint_store(tcx.sess); rustc_lint::check_ast_node( sess, + Some(tcx), tcx.features(), false, lint_store, |
