@@ -503,20 +503,42 @@ so forbidding them in traits seems like the best initial course of action.
503
503
504
504
> Why should we * not * do this ?
505
505
506
+ ## Drawbacks due to the proposal 's minimalism
507
+
506
508
As has been elaborated on above , there are various way this feature could be
507
- extended and combined with the language , so implementing it might
508
- cause issues down the road if limitations or incompatibilities become apparent .
509
+ extended and combined with the language , so implementing it might cause issues
510
+ down the road if limitations or incompatibilities become apparent . However ,
511
+ variations of this RFC 's proposal have been under discussion for quite a long
512
+ time at this point , and this proposal is carefully designed to be
513
+ future - compatible with them , while resolving the core issue around transparency .
514
+
515
+ A drawback of limiting the feature to return type position (and not arguments )
516
+ is that it creates a somewhat inconsistent mental model : it forces you to
517
+ understand the feature in a highly special - cased way , rather than as a general
518
+ way to talk about unknown - but - bounded types in function signatures . This could
519
+ be particularly bewildering to newcomers , who must choose between `T : Trait `,
520
+ `Box <Trait >`, and `@ Trait `, with the latter only usable in one place .
521
+
522
+ ## Drawbacks due to partial transparency
523
+
524
+ The fact that specialization and OIBITs can " see through" `@ Trait ` may be
525
+ surprising , to the extent that one wants to see `@ Trait ` as an abstraction
526
+ mechanism . However , as the RFC argued in the rationale section , this design is
527
+ probably the most consistent with our existing post - specialization abstraction
528
+ mechanisms , and lead to the relatively simple story that * privacy * is the way to
529
+ achieve hiding in Rust .
509
530
510
531
# Alternatives
511
532
[alternatives ]: #alternatives
512
533
513
534
> What other designs have been considered ? What is the impact of not doing this ?
514
535
515
- See the links in the motivation section for a more detailed analysis .
536
+ See the links in the motivation section for detailed analysis that we won 't
537
+ repeat here .
516
538
517
539
But basically , without this feature certain things remain hard or impossible to do
518
540
in Rust , like returning a efficiently usable type parametricised by
519
- types private to a function body , for example a iterator adapter containing a closure .
541
+ types private to a function body , for example an iterator adapter containing a closure .
520
542
521
543
# Unresolved questions
522
544
[unresolved ]: #unresolved - questions
0 commit comments