needs_drop intrinsic #2055
Labels
A-codegen
Area: Code generation
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
We should add a
needs_drop<T>
intrinsic that is true if the type requires drop glue. We could then implement avec::clear()
method that clears out the contents of a vector efficiently, avoiding the execution of drop glue if the vector has a type like[int]
.vec::slice()
is another example of where this might be useful.The text was updated successfully, but these errors were encountered: