Skip to content

Commit

Permalink
Rollup merge of rust-lang#90544 - ehuss:demote-locator-warn, r=petroc…
Browse files Browse the repository at this point in the history
…henkov

Demote metadata load warning to "info".

There is a warn log message for whenever the crate loader fails to load metadata from a candidate file. I think this warning is too aggressive, as there are several situations where metadata information might not be found in a candidate file, which is normal. Also, this warning is somewhat confusing, and non-actionable in most cases for a user (most users will not know what it means).

If the crate loader ultimately does not find a valid crate, then an error will be reported (and hopefully rust-lang#88368 will improve that error message).

If a rustc developer wants to debug a loader problem, they can still use `RUSTC_LOG=rustc_metadata=debug` and get the details.

There is more discussion of this particular warning at rust-lang#89795 (comment).

Fixes rust-lang#90525
  • Loading branch information
matthiaskrgr authored Nov 4, 2021
2 parents cb27ba3 + 9057936 commit 7448b8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_metadata/src/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ use std::fmt::Write as _;
use std::io::{Read, Result as IoResult, Write};
use std::path::{Path, PathBuf};
use std::{cmp, fmt, fs};
use tracing::{debug, info, warn};
use tracing::{debug, info};

#[derive(Clone)]
crate struct CrateLocator<'a> {
Expand Down Expand Up @@ -549,7 +549,7 @@ impl<'a> CrateLocator<'a> {
}
}
Err(err) => {
warn!("no metadata found: {}", err);
info!("no metadata found: {}", err);
continue;
}
};
Expand Down

0 comments on commit 7448b8f

Please sign in to comment.