Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/cargo/core/compiler/unit_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
//!
//! [`--unit-graph`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#unit-graph

use cargo_util_schemas::core::PackageIdSpec;

use crate::core::compiler::Unit;
use crate::core::compiler::{CompileKind, CompileMode};
use crate::core::profiles::{Profile, UnitFor};
use crate::core::{PackageId, Target};
use crate::core::Target;
use crate::util::interning::InternedString;
use crate::util::CargoResult;
use crate::GlobalContext;
Expand Down Expand Up @@ -47,7 +49,7 @@ struct SerializedUnitGraph<'a> {

#[derive(serde::Serialize)]
struct SerializedUnit<'a> {
pkg_id: PackageId,
pkg_id: PackageIdSpec,
target: &'a Target,
profile: &'a Profile,
platform: CompileKind,
Expand Down Expand Up @@ -109,7 +111,7 @@ pub fn emit_serialized_unit_graph(
})
.collect();
SerializedUnit {
pkg_id: unit.pkg.package_id(),
pkg_id: unit.pkg.package_id().to_spec(),
target: &unit.target,
profile: &unit.profile,
platform: unit.kind,
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/unit_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn simple() {
"feata"
],
"mode": "build",
"pkg_id": "a 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg_id": "registry+https://github.com/rust-lang/crates.io-index#a@1.0.0",
"platform": null,
"profile": {
"codegen_backend": null,
Expand Down Expand Up @@ -113,7 +113,7 @@ fn simple() {
"featb"
],
"mode": "build",
"pkg_id": "b 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg_id": "registry+https://github.com/rust-lang/crates.io-index#b@1.0.0",
"platform": null,
"profile": {
"codegen_backend": null,
Expand Down Expand Up @@ -151,7 +151,7 @@ fn simple() {
"featc"
],
"mode": "build",
"pkg_id": "c 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg_id": "registry+https://github.com/rust-lang/crates.io-index#c@1.0.0",
"platform": null,
"profile": {
"codegen_backend": null,
Expand Down Expand Up @@ -194,7 +194,7 @@ fn simple() {
],
"features": [],
"mode": "build",
"pkg_id": "foo 0.1.0 (path+[ROOTURL]/foo)",
"pkg_id": "path+[ROOTURL]/foo#0.1.0",
"platform": null,
"profile": {
"codegen_backend": null,
Expand Down