mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor(manifest): Clarify which diagnostic source
This commit is contained in:
parent
378bc91cd6
commit
433457447c
@ -69,10 +69,10 @@ pub fn read_manifest(
|
|||||||
let is_embedded = is_embedded(path);
|
let is_embedded = is_embedded(path);
|
||||||
let contents = read_toml_string(path, is_embedded, gctx)
|
let contents = read_toml_string(path, is_embedded, gctx)
|
||||||
.map_err(|err| ManifestError::new(err, path.into()))?;
|
.map_err(|err| ManifestError::new(err, path.into()))?;
|
||||||
let document =
|
let document = parse_document(&contents)
|
||||||
parse_document(&contents).map_err(|e| emit_diagnostic(e.into(), &contents, path, gctx))?;
|
.map_err(|e| emit_toml_diagnostic(e.into(), &contents, path, gctx))?;
|
||||||
let original_toml = deserialize_toml(&document)
|
let original_toml = deserialize_toml(&document)
|
||||||
.map_err(|e| emit_diagnostic(e.into(), &contents, path, gctx))?;
|
.map_err(|e| emit_toml_diagnostic(e.into(), &contents, path, gctx))?;
|
||||||
|
|
||||||
let mut manifest = (|| {
|
let mut manifest = (|| {
|
||||||
let empty = Vec::new();
|
let empty = Vec::new();
|
||||||
@ -2777,7 +2777,7 @@ fn lints_to_rustflags(lints: &manifest::TomlLints) -> CargoResult<Vec<String>> {
|
|||||||
Ok(rustflags)
|
Ok(rustflags)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_diagnostic(
|
fn emit_toml_diagnostic(
|
||||||
e: toml::de::Error,
|
e: toml::de::Error,
|
||||||
contents: &str,
|
contents: &str,
|
||||||
manifest_file: &Path,
|
manifest_file: &Path,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user