diff --git a/src/cargo/core/manifest.rs b/src/cargo/core/manifest.rs index 76e90f9f8..23a2cf9b0 100644 --- a/src/cargo/core/manifest.rs +++ b/src/cargo/core/manifest.rs @@ -63,7 +63,7 @@ impl EitherManifest { pub struct Manifest { // alternate forms of manifests: contents: Rc, - document: Rc>, + document: Rc>, original_toml: Rc, normalized_toml: Rc, summary: Summary, @@ -109,7 +109,7 @@ pub struct Warnings(Vec); pub struct VirtualManifest { // alternate forms of manifests: contents: Rc, - document: Rc>, + document: Rc>, original_toml: Rc, normalized_toml: Rc, @@ -496,7 +496,7 @@ compact_debug! { impl Manifest { pub fn new( contents: Rc, - document: Rc>, + document: Rc>, original_toml: Rc, normalized_toml: Rc, summary: Summary, @@ -565,7 +565,7 @@ impl Manifest { Ok(format!("{}\n{}", MANIFEST_PREAMBLE, toml)) } /// Collection of spans for the original TOML - pub fn document(&self) -> &toml_edit::ImDocument { + pub fn document(&self) -> &toml_edit::Document { &self.document } /// The [`TomlManifest`] as parsed from [`Manifest::document`] @@ -738,7 +738,7 @@ impl Manifest { impl VirtualManifest { pub fn new( contents: Rc, - document: Rc>, + document: Rc>, original_toml: Rc, normalized_toml: Rc, replace: Vec<(PackageIdSpec, Dependency)>, @@ -766,7 +766,7 @@ impl VirtualManifest { self.contents.as_str() } /// Collection of spans for the original TOML - pub fn document(&self) -> &toml_edit::ImDocument { + pub fn document(&self) -> &toml_edit::Document { &self.document } /// The [`TomlManifest`] as parsed from [`VirtualManifest::document`] diff --git a/src/cargo/util/lints.rs b/src/cargo/util/lints.rs index 025384487..9fac19bc7 100644 --- a/src/cargo/util/lints.rs +++ b/src/cargo/util/lints.rs @@ -6,7 +6,7 @@ use pathdiff::diff_paths; use std::fmt::Display; use std::ops::Range; use std::path::Path; -use toml_edit::ImDocument; +use toml_edit::Document; const LINT_GROUPS: &[LintGroup] = &[TEST_DUMMY_UNSTABLE]; pub const LINTS: &[Lint] = &[IM_A_TEAPOT, UNKNOWN_LINTS]; @@ -16,7 +16,7 @@ pub fn analyze_cargo_lints_table( path: &Path, pkg_lints: &TomlToolLints, ws_contents: &str, - ws_document: &ImDocument, + ws_document: &Document, ws_path: &Path, gctx: &GlobalContext, ) -> CargoResult<()> { @@ -116,7 +116,7 @@ fn verify_feature_enabled( manifest: &Manifest, manifest_path: &str, ws_contents: &str, - ws_document: &ImDocument, + ws_document: &Document, ws_path: &str, error_count: &mut usize, gctx: &GlobalContext, @@ -191,7 +191,7 @@ fn verify_feature_enabled( } pub fn get_span( - document: &ImDocument, + document: &Document, path: &[&str], get_value: bool, ) -> Option> { @@ -511,7 +511,7 @@ fn output_unknown_lints( manifest_path: &str, pkg_lints: &TomlToolLints, ws_contents: &str, - ws_document: &ImDocument, + ws_document: &Document, ws_path: &str, error_count: &mut usize, gctx: &GlobalContext, diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 28f9ba738..da6a51550 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -19,7 +19,7 @@ use cargo_util_schemas::manifest::{RustVersion, StringOrBool}; use itertools::Itertools; use lazycell::LazyCell; use pathdiff::diff_paths; -use toml_edit::ImDocument; +use toml_edit::Document; use url::Url; use crate::core::compiler::{CompileKind, CompileTarget}; @@ -166,13 +166,13 @@ fn read_toml_string(path: &Path, is_embedded: bool, gctx: &GlobalContext) -> Car } #[tracing::instrument(skip_all)] -fn parse_document(contents: &str) -> Result, toml_edit::de::Error> { - toml_edit::ImDocument::parse(contents.to_owned()).map_err(Into::into) +fn parse_document(contents: &str) -> Result, toml_edit::de::Error> { + toml_edit::Document::parse(contents.to_owned()).map_err(Into::into) } #[tracing::instrument(skip_all)] fn deserialize_toml( - document: &toml_edit::ImDocument, + document: &toml_edit::Document, ) -> Result { let mut unused = BTreeSet::new(); let deserializer = toml_edit::de::Deserializer::from(document.clone()); @@ -1256,7 +1256,7 @@ fn deprecated_ws_default_features( #[tracing::instrument(skip_all)] pub fn to_real_manifest( contents: String, - document: toml_edit::ImDocument, + document: toml_edit::Document, original_toml: manifest::TomlManifest, normalized_toml: manifest::TomlManifest, features: Features, @@ -1843,7 +1843,7 @@ pub fn to_real_manifest( fn missing_dep_diagnostic( missing_dep: &MissingDependencyError, orig_toml: &TomlManifest, - document: &ImDocument, + document: &Document, contents: &str, manifest_file: &Path, gctx: &GlobalContext, @@ -1921,7 +1921,7 @@ fn missing_dep_diagnostic( fn to_virtual_manifest( contents: String, - document: toml_edit::ImDocument, + document: toml_edit::Document, original_toml: manifest::TomlManifest, normalized_toml: manifest::TomlManifest, features: Features,