@@ -90,7 +90,9 @@ pub fn write_toml_file(path: &Path, doc: &DocumentMut) -> RailResult<()> {
9090pub fn build_dep_entry ( dep : & UnifiedDep ) -> Item {
9191 // Simple case: just version, no features, defaults enabled, no path
9292 if dep. features . is_empty ( ) && dep. default_features && dep. path . is_none ( ) {
93- return Item :: Value ( Value :: from ( dep. version_req . to_string ( ) ) ) ;
93+ let mut value = Value :: from ( dep. version_req . to_string ( ) ) ;
94+ value. decor_mut ( ) . set_suffix ( " #unified" ) ;
95+ return Item :: Value ( value) ;
9496 }
9597
9698 // Complex case: use inline table
@@ -118,7 +120,11 @@ pub fn build_dep_entry(dep: &UnifiedDep) -> Item {
118120 table. insert ( "features" , build_feature_array ( & dep. features ) ) ;
119121 }
120122
121- Item :: Value ( Value :: InlineTable ( table) )
123+ // Add #unified comment marker
124+ let mut value = Value :: InlineTable ( table) ;
125+ value. decor_mut ( ) . set_suffix ( " #unified" ) ;
126+
127+ Item :: Value ( value)
122128}
123129
124130/// Build a workspace-inherited dependency entry
@@ -132,7 +138,7 @@ pub fn build_dep_entry(dep: &UnifiedDep) -> Item {
132138///
133139/// # Returns
134140///
135- /// `{ workspace = true }` with optional fields
141+ /// `{ workspace = true }` with optional fields and `#unified` comment marker
136142pub fn build_workspace_dep_entry ( local_features : Option < Vec < String > > , is_optional : bool ) -> Item {
137143 let mut table = InlineTable :: new ( ) ;
138144 table. insert ( "workspace" , Value :: from ( true ) ) ;
@@ -149,7 +155,11 @@ pub fn build_workspace_dep_entry(local_features: Option<Vec<String>>, is_optiona
149155 table. insert ( "optional" , Value :: from ( true ) ) ;
150156 }
151157
152- Item :: Value ( Value :: InlineTable ( table) )
158+ // Add #unified comment marker to track what was modified by unify
159+ let mut value = Value :: InlineTable ( table) ;
160+ value. decor_mut ( ) . set_suffix ( " #unified" ) ;
161+
162+ Item :: Value ( value)
153163}
154164
155165/// Build a transitive dependency entry for pinning
@@ -167,7 +177,11 @@ pub fn build_transitive_entry(features: &[String]) -> Item {
167177 table. insert ( "features" , build_feature_array ( features) ) ;
168178 }
169179
170- Item :: Value ( Value :: InlineTable ( table) )
180+ // Add #unified comment marker
181+ let mut value = Value :: InlineTable ( table) ;
182+ value. decor_mut ( ) . set_suffix ( " #unified" ) ;
183+
184+ Item :: Value ( value)
171185}
172186
173187// ============================================================================
0 commit comments