-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Extending ? macro repetition to Rust 2015 #56668
Copy link
Copy link
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
We recently stabilized the
?macro repeater "operator" proposed by @mark-i-m for Rust 2018 and it will be in Rust 1.32.The original rust-lang/rfcs#2298 did not say anything about using edition dependent behavior; this was instead decided upon with an FCP in #51934. This was done after a crater run in #49719 (comment) that was green and showed 0 regressions.
After accepting the edition dependent change, @petrochenkov noted in #51934 (comment) that:
However, in #53668, there was a similar situation of a syntactic change for non-soundness reasons that was theoretically breaking but in practice not. In that case, @rust-lang/lang decided to accept the change for Rust 2015 and 2018 in an effort to minimize technical debt.
In #53668 @petrochenkov noted that (#53668 (comment)):
In #53668 (comment), @nikomatsakis then expanded upon the practical way in which we interpret breaking changes.
If I recall correctly, in a language team meeting not too long ago, it was suggested that we might want to reverse our decision and extend
?as a macro repetition "operator" in Rust 2015 as well. I think personally that it would be advisable; in particular, if we do so, we can avoid the technical debt in the compiler, the debt in the spec, but first and foremost, we can avoid the distinction that users must learn. Ultimately I think this is of greater practical benefit than the theoretical breakage that it would be according to crater.Therefore I'd like to use this issue to propose an extension of
?as a macro repetition "operator" to Rust 2015.@mark-i-m noted that they would rather not have to change the implementation again so I will not ask them to; but I'm sure someone else might want to tackle it (e.g. @petrochenkov since they were one of the first proponents of keeping it in Rust 2015 or @alexreg since they concurred with @petrochenkov).
Thoughts?