session: diagnostic migration lint on more fns
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
@@ -114,7 +114,9 @@ use rustc_span::symbol::Symbol;
|
||||
|
||||
use crate::collector::InliningMap;
|
||||
use crate::collector::{self, MonoItemCollectionMode};
|
||||
use crate::errors::{CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownPartitionStrategy};
|
||||
use crate::errors::{
|
||||
CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownCguCollectionMode, UnknownPartitionStrategy,
|
||||
};
|
||||
|
||||
pub struct PartitioningCx<'a, 'tcx> {
|
||||
tcx: TyCtxt<'tcx>,
|
||||
@@ -348,17 +350,13 @@ where
|
||||
fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[CodegenUnit<'_>]) {
|
||||
let collection_mode = match tcx.sess.opts.unstable_opts.print_mono_items {
|
||||
Some(ref s) => {
|
||||
let mode_string = s.to_lowercase();
|
||||
let mode_string = mode_string.trim();
|
||||
if mode_string == "eager" {
|
||||
let mode = s.to_lowercase();
|
||||
let mode = mode.trim();
|
||||
if mode == "eager" {
|
||||
MonoItemCollectionMode::Eager
|
||||
} else {
|
||||
if mode_string != "lazy" {
|
||||
let message = format!(
|
||||
"Unknown codegen-item collection mode '{mode_string}'. \
|
||||
Falling back to 'lazy' mode."
|
||||
);
|
||||
tcx.sess.warn(&message);
|
||||
if mode != "lazy" {
|
||||
tcx.sess.emit_warning(UnknownCguCollectionMode { mode });
|
||||
}
|
||||
|
||||
MonoItemCollectionMode::Lazy
|
||||
|
||||
Reference in New Issue
Block a user