Skip to content

Commit 2efc83d

Browse files
committed
fix unused lint
1 parent 5a6de3f commit 2efc83d

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

compiler/rustc_hir_typeck/src/expr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
190190

191191
/// Check an expr with an expectation type which may be used to eagerly
192192
/// guide inference when evaluating that expr.
193-
#[instrument(skip(self, expr), level = "debug")]
194193
pub(super) fn check_expr_with_expectation(
195194
&self,
196195
expr: &'tcx hir::Expr<'tcx>,

compiler/rustc_metadata/src/creader.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use rustc_session::search_paths::PathKind;
3434
use rustc_span::edition::Edition;
3535
use rustc_span::{DUMMY_SP, Ident, Span, Symbol, sym};
3636
use rustc_target::spec::{PanicStrategy, Target, TargetTuple};
37-
use tracing::{debug, info, trace};
37+
use tracing::{debug, info, instrument, trace};
3838

3939
use crate::errors;
4040
use crate::locator::{CrateError, CrateLocator, CratePaths};
@@ -1225,11 +1225,14 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
12251225
}
12261226
}
12271227

1228+
#[instrument(skip(self, krate), level = "debug")]
12281229
fn report_unused_deps(&mut self, krate: &ast::Crate) {
12291230
// Make a point span rather than covering the whole file
12301231
let span = krate.spans.inner_span.shrink_to_lo();
12311232
// Complain about anything left over
12321233
for (name, entry) in self.sess.opts.externs.iter() {
1234+
debug!(?name, ?entry);
1235+
debug!("used_extern_options: {:?}", self.used_extern_options);
12331236
if let ExternLocation::FoundInLibrarySearchDirectories = entry.location {
12341237
// Don't worry about pathless `--extern foo` sysroot references
12351238
continue;

compiler/rustc_resolve/src/build_reduced_graph.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
162162
ident: Ident,
163163
finalize: bool,
164164
) -> Module<'ra> {
165-
if let Some(module) = self.module_map.get(&def_id) {
166-
return *module;
165+
if finalize {
166+
self.used_extern_options.insert(ident.name);
167167
}
168168

169-
if finalize {
170-
self.crate_loader(|c| c.process_path_extern(ident.name, ident.span));
169+
if let Some(module) = self.module_map.get(&def_id) {
170+
return *module;
171171
}
172172

173173
let def_kind = self.cstore().def_kind_untracked(def_id);
@@ -1036,7 +1036,7 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
10361036
});
10371037
crate_id.map(|crate_id| {
10381038
self.r.extern_crate_map.insert(local_def_id, crate_id);
1039-
self.r.create_module_for_external_crate(crate_id.as_def_id(), ident, false)
1039+
self.r.create_module_for_external_crate(crate_id.as_def_id(), ident, true)
10401040
})
10411041
}
10421042
.map(|module| {

compiler/rustc_resolve/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
21892189
NameBindingKind::Module(module) => match module.kind {
21902190
ModuleKind::NamespaceCrate(..) => {
21912191
// This is a virtual module
2192+
debug!("{:?} is virtual module", norm_ident);
21922193
}
21932194
_ => {
21942195
self.crate_loader(|c| {
@@ -2208,7 +2209,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
22082209
}
22092210
binding
22102211
} else {
2211-
let crate_root = if finalize {
2212+
let crate_module = if finalize {
22122213
if let Some(crate_id) =
22132214
self.crate_loader(|c| c.maybe_process_path_extern(ident.name))
22142215
{
@@ -2242,9 +2243,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
22422243
}
22432244
};
22442245

2245-
debug!(?crate_root);
2246+
debug!(?crate_module);
22462247
let vis = ty::Visibility::<DefId>::Public;
2247-
(crate_root, vis, DUMMY_SP, LocalExpnId::ROOT).to_name_binding(self.arenas)
2248+
(crate_module, vis, DUMMY_SP, LocalExpnId::ROOT).to_name_binding(self.arenas)
22482249
})
22492250
});
22502251

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ options! {
23352335
mutable_noalias: bool = (true, parse_bool, [TRACKED],
23362336
"emit noalias metadata for mutable references (default: yes)"),
23372337
namespaced_crates: bool = (false, parse_bool, [TRACKED],
2338-
"allow crates to be nested in other crates (default: no)"),
2338+
"allow crates to be namespaced by other crates (default: no)"),
23392339
next_solver: NextSolverConfig = (NextSolverConfig::default(), parse_next_solver_config, [TRACKED],
23402340
"enable and configure the next generation trait solver used by rustc"),
23412341
nll_facts: bool = (false, parse_bool, [UNTRACKED],

0 commit comments

Comments
 (0)