@@ -390,6 +390,10 @@ Trait aliases cannot be implemented. As such, there is no concern about compatib
390
390
they would be with the proposed syntax. It would also mean macro authors would be unable to accept
391
391
only syntax that would be valid in a given context. Further, some positions such as ` enum `
392
392
variants do not semantically accept a visibility, while they do accept a restriction.
393
+ - The current syntax separates the ` mut ` /` impl ` keyword from the scope of the restriction. This
394
+ produces verbose syntax. Many users may want similar restrictions. Could we provide a simpler
395
+ syntax if we provided less flexibility? Would a new keyword or two help? We could choose a syntax
396
+ with less flexibility and verbosity but more simplicity. For instance, ` sealed ` or ` readonly ` .
393
397
394
398
# Prior art
395
399
@@ -444,6 +448,8 @@ Trait aliases cannot be implemented. As such, there is no concern about compatib
444
448
- Should ` struct ` expressions be disallowed?
445
449
- Where would it be desirable to prohibit mutability after construction, but still permit
446
450
construction with unchecked values?
451
+ - Should a simpler syntax be provided for common cases? For instance, ` sealed ` or ` readonly ` . A
452
+ different syntax altogether could be used as well.
447
453
448
454
# Future possibilities
449
455
@@ -463,3 +469,4 @@ Trait aliases cannot be implemented. As such, there is no concern about compatib
463
469
identical to omitting the keyword entirely.
464
470
- ` mut ` could be placed on the ` struct ` or variant itself, which would be equivalent to having the
465
471
same restriction on each field. This would avoid repetition.
472
+ - Trait implementations could be restricted to being used within a certain scope.
0 commit comments