diff options
| author | blyxyas <blyxyas@gmail.com> | 2023-04-09 21:37:31 +0200 |
|---|---|---|
| committer | blyxyas <blyxyas@gmail.com> | 2023-04-09 21:37:31 +0200 |
| commit | 2c976765b8e426506285b334e0a1506c78b135e2 (patch) | |
| tree | 00ba1bc5b3a493110076b1b4842c899d0659fe62 /compiler/rustc_resolve/src/check_unused.rs | |
| parent | 28e19f19aaa9388814fb0cc358e18258127397f3 (diff) | |
| download | rust-2c976765b8e426506285b334e0a1506c78b135e2.tar.gz rust-2c976765b8e426506285b334e0a1506c78b135e2.zip | |
Migrate `sess.opts.tests` uses to `sess.is_test_crate()`
Diffstat (limited to 'compiler/rustc_resolve/src/check_unused.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/check_unused.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/check_unused.rs b/compiler/rustc_resolve/src/check_unused.rs index dbf6cec788b..ae3fd0ede6c 100644 --- a/compiler/rustc_resolve/src/check_unused.rs +++ b/compiler/rustc_resolve/src/check_unused.rs @@ -393,7 +393,7 @@ impl Resolver<'_, '_> { // If we are in the `--test` mode, suppress a help that adds the `#[cfg(test)]` // attribute; however, if not, suggest adding the attribute. There is no way to // retrieve attributes here because we do not have a `TyCtxt` yet. - let test_module_span = if tcx.sess.opts.test { + let test_module_span = if tcx.sess.is_test_crate() { None } else { let parent_module = visitor.r.get_nearest_non_block_module( |
