This proposal makes me feel concerned about layering.
Though you ddn’t say how this would be implemented, the most obvious implementation to me is this: rustc would gain a notion of a ‘workspace’, and would be passed a set of crates which are ‘in the same workspace’ as the target crate, and coherence rules would be modified to treat all types and traits in those crates as local. If this is significantly different from what you had in mind, please let me know.
In such a case, although cargo may provide enforcement that rustc’s workspaces map to cargo’s workspaces, and may limit how you can define workspacess such that only ‘your’ crates are within your workspace, rustc makes no such provision. Using rustc directly I could trivially add any dependency to ‘my workspace’, making orphan rules unenforceable outside of the cargo ecosystem.
Obviously I can also just copypaste the body of any crate into my own to get around the orphan rules right now, but that’s a much steeper obligation than changing how I pass dependency args.
If this use case for features is a very common use case (and I imagine it is), it seems like the right course is to make it more usable.
For example, there could be a new kind of feature which is semantically associated with a dependency (probably this association would be best applied in cargo). Cargo could get the dependency graph without any of these features enabled, and then for each crate automatically look for the dependencies associated with features and enable them. Authors would just need to add one of these ‘dependency-features’ (a better name is needed) to their toml, apply an attribute to a module containing all uses and imports of that dependency, and users would have to do nothing at all. If this proposal is viable, it seems even more usable than the workspaces proposal.