fallout from Sound Generic Drop to be addressed later · Issue #22321 · rust-lang/rust (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
This is meant as a meta-bug for me to collect references to places where users complained about fallout from Sound Generic Drop (#21972) and its precursors (namely #21657 in particular).
It might be a places to pose ideas for ways to address complaints, but keeping in mind the distinction between language features versus tooling, I would prefer for the comments on this ticket to focus on things we can do without changing the language per se, and try to put language changes somewhere on the RFC repo. For example, ways to encode "this destructor for this type is pure" is an example of such a language feature.
(I do not know where something like "borrow scopes should not always be lexical" (#6393) falls in that categorization; that might be an example of something that would not require an RFC, but maybe it does at this point.)
Potential work items:
- Make
Vec<T>
,Box<T>
,Rc<T>
, etc, covariant with respect toT
. Discussed on issue new scoping rules for safe dtors may benefit from variance on type params #21198 (was not a strict requirement for landing new destructor semantics). - Track even finer grained scopes, e.g. destruction order of temporary rvalues in an expression. Issue dropck: track order of destruction for r-value temporaries #22323
- fixed by non-lexical lifetimes (NLL), so @pnkfelix is choosing to check off its box here.
- Implement refined Drop check rule that respects the side-condition "where T is a trait that has at least one
methoditem" dropck: Ignore bounds for traits without any items #24805 - uses of terms "superregion" and "subregion" suboptimal dropck: uses of terms "superregion" and "subregion" suboptimal #22171
- new scoping rules for safe dtors can yield spurious semi-colon or trailing unit expr new scoping rules for safe dtors can yield spurious semi-colon or trailing unit expr #21114
- Temporary lifetimes sometimes yield surprising errors Temporary lifetimes sometimes yield surprising errors #46413
- (Note that with non-lexical lifetimes (NLL) enabled, Temporary lifetimes sometimes yield surprising errors #46413 is effectively a duplicate of new scoping rules for safe dtors can yield spurious semi-colon or trailing unit expr #21114.)
key terms: destruction scope, block suffix, unsafe_destructor