Commit cfde2ac
committed
update: report error for non-matching package specs with --breaking
When using `cargo update --breaking <spec>`, package specifications
that don't match any upgradeable dependency are now properly reported
as errors instead of being silently ignored.
The implementation tracks which specs match direct dependencies during
the upgrade process. After processing all workspace members, it
validates that each requested spec either:
1. Matched a direct registry dependency (and was processed), or
2. Exists in the lockfile but cannot be upgraded
Specs that match neither category produce clear error messages:
- "did not match any packages" for completely non-existent packages
- "matched a package... but did not match any direct dependencies"
for transitive/non-upgradeable packages, with a note explaining
that --breaking can only upgrade direct dependencies
Multiple errors are collected and reported together for better UX.
This fixes the confusing behavior where users could specify packages
that don't exist without receiving any feedback.1 parent e619bf0 commit cfde2ac
2 files changed
+95
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
| 257 | + | |
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
260 | 296 | | |
261 | 297 | | |
262 | 298 | | |
| |||
266 | 302 | | |
267 | 303 | | |
268 | 304 | | |
| 305 | + | |
269 | 306 | | |
270 | 307 | | |
271 | 308 | | |
272 | 309 | | |
273 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
274 | 317 | | |
275 | 318 | | |
276 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
2164 | | - | |
| 2164 | + | |
| 2165 | + | |
2165 | 2166 | | |
| 2167 | + | |
2166 | 2168 | | |
2167 | | - | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
2168 | 2183 | | |
2169 | 2184 | | |
2170 | 2185 | | |
| |||
2779 | 2794 | | |
2780 | 2795 | | |
2781 | 2796 | | |
2782 | | - | |
2783 | | - | |
2784 | | - | |
2785 | | - | |
2786 | | - | |
2787 | | - | |
| 2797 | + | |
2788 | 2798 | | |
2789 | 2799 | | |
| 2800 | + | |
2790 | 2801 | | |
| 2802 | + | |
2791 | 2803 | | |
2792 | 2804 | | |
2793 | 2805 | | |
2794 | 2806 | | |
2795 | | - | |
| 2807 | + | |
2796 | 2808 | | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
2797 | 2821 | | |
2798 | 2822 | | |
2799 | 2823 | | |
| |||
2805 | 2829 | | |
2806 | 2830 | | |
2807 | 2831 | | |
2808 | | - | |
| 2832 | + | |
2809 | 2833 | | |
2810 | 2834 | | |
| 2835 | + | |
2811 | 2836 | | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
2812 | 2854 | | |
2813 | 2855 | | |
2814 | 2856 | | |
| |||
0 commit comments