Read and use deprecated configuration (as well as emitting a warning)

Co-authored-by: Andy Caldwell <andycaldwell@microsoft.com>
This commit is contained in:
Philipp Krones
2022-07-27 17:18:20 +01:00
committed by Andy Caldwell
parent d814681429
commit 08e7ec4047
5 changed files with 46 additions and 10 deletions

View File

@@ -487,7 +487,7 @@ pub fn read_conf(sess: &Session) -> Conf {
},
};
let TryConf { conf, errors } = utils::conf::read(&file_name);
let TryConf { conf, errors, warnings } = utils::conf::read(&file_name);
// all conf errors are non-fatal, we just use the default conf in case of error
for error in errors {
sess.err(&format!(
@@ -497,6 +497,15 @@ pub fn read_conf(sess: &Session) -> Conf {
));
}
for warning in warnings {
sess.struct_warn(&format!(
"error reading Clippy's configuration file `{}`: {}",
file_name.display(),
format_error(warning)
))
.emit();
}
conf
}