Closed Bug 1628715 Opened 5 years ago Closed 4 years ago

Improve use of nodiscard and nonnull_return attributes in nsTArray

Categories

(Core :: XPCOM, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: sg, Assigned: sg)

References

(Blocks 7 open bugs)

Details

Attachments

(18 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
No description provided.

Also prepare disabling copy construction and assignment in Bug 1628692.

Depends on D70382

One goal in particular is that all functions that return elem_type* have either the nodiscard or the nonnull_return attribute.

Attachment #9139484 - Attachment description: Bug 1628715 - Add MOZ_NONNULL_RETURN attributes to some nsTArray functions. r=#xpcom-reviewers → Bug 1628715 - Part 1: Add MOZ_NONNULL_RETURN attributes to some nsTArray functions. r=#xpcom-reviewers
Attachment #9139485 - Attachment description: Bug 1628715 - Disable copy assignment to FallibleTArray from infallible nsTArray. r=#xpcom-reviewers → Bug 1628715 - Part 2: Disable copy assignment to FallibleTArray from infallible nsTArray. r=#xpcom-reviewers
Attachment #9139486 - Attachment description: Bug 1628715 - Make fallible nsTArray::Assign nodiscard. r=#xpcom-reviewers → Bug 1628715 - Part 3: Make fallible nsTArray::Assign nodiscard. r=#xpcom-reviewers
Attachment #9139487 - Attachment description: Bug 1628715 - Add MOZ_NONNULL_RETURN to infallible nsTArray::ReplaceElementsAt. r=#xpcom-reviewers → Bug 1628715 - Part 4: Add MOZ_NONNULL_RETURN to infallible nsTArray::ReplaceElementsAt. r=#xpcom-reviewers
Attachment #9139524 - Attachment description: Bug 1628715 - Add MOZ_NONNULL_RETURN to infallible nsTArray::InsertElementsAt. r=#xpcom-reviewers → Bug 1628715 - Part 5: Add MOZ_NONNULL_RETURN to infallible nsTArray::InsertElementsAt. r=#xpcom-reviewers
Attachment #9139488 - Attachment description: Bug 1628715 - Remove unused and redundant AppendElements overload. r=#xpcom-reviewers → Bug 1628715 - Part 6: Remove unused and redundant AppendElements overload. r=#xpcom-reviewers
Attachment #9140387 - Attachment description: Bug 1628715 - Part 12: Add nodiscard attribute to SwapElements. r=#xpcom-reviewers → Bug 1628715 - Part 1bis: Add nodiscard attribute to SwapElements. r=#xpcom-reviewers
Attachment #9140783 - Attachment description: Bug 1628715 - Part 7bis: Add gtests from nsTArray::AppendElements. r=#xpcom-reviewers → Bug 1628715 - Part 7bis: Add gtests for nsTArray::AppendElements. r=#xpcom-reviewers
Attachment #9141207 - Attachment description: Bug 1628715 - Part 12: Add WrapNotNullUnsafe for NotNull<T*>. r=#xpcom-reviewers → Bug 1628715 - Part 12: Add WrapNotNullUnchecked for NotNull<T*>. r=#xpcom-reviewers
Blocks: 1631367
Blocks: 1631371
Blocks: 1631374
Blocks: 1631381
Blocks: 1631386
Blocks: 1631391
See Also: → 1628692
Blocks: 1632090
Blocks: 1632142
Keywords: leave-open
Blocks: 1632814
Keywords: leave-open
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f639011a7bbd Part 1bis: Add nodiscard attribute to SwapElements. r=xpcom-reviewers,nika,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/6e6528dfcb64 Part 1: Add MOZ_NONNULL_RETURN attributes to some nsTArray functions. r=xpcom-reviewers,erahm https://hg.mozilla.org/integration/autoland/rev/6bec0aa0bc30 Part 2: Disable copy assignment to FallibleTArray from infallible nsTArray. r=xpcom-reviewers,erahm https://hg.mozilla.org/integration/autoland/rev/7b3f5e09731f Part 3: Make fallible nsTArray::Assign nodiscard. r=xpcom-reviewers,erahm https://hg.mozilla.org/integration/autoland/rev/25187269c1f7 Part 4bis: Make nsTArray*AllocatorBase methods constexpr. r=nika,xpcom-reviewers https://hg.mozilla.org/integration/autoland/rev/32405f37c706 Part 4: Add MOZ_NONNULL_RETURN to infallible nsTArray::ReplaceElementsAt. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/57b27245870f Part 5: Add MOZ_NONNULL_RETURN to infallible nsTArray::InsertElementsAt. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/0d7fd40a8167 Part 6: Remove unused and redundant AppendElements overload. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/172770f1f622 Part 7bis: Add gtests for nsTArray::AppendElements. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/581ca795e0d4 Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin https://hg.mozilla.org/integration/autoland/rev/c86649abd7f2 Part 8: Add MOZ_NONNULL_RETURN to ReconstructElementAt. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/63944721b070 Part 9: Add MOZ_NONNULL_RETURN to InsertElementSorted. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/d6ceb381cd5f Part 10: Activate nodiscard attributes on AppendElement(s). r=xpcom-reviewers,nika,peterv https://hg.mozilla.org/integration/autoland/rev/95b61550e69d Part 11: Add nodiscard attribute to functions unrelated to memory allocation. r=xpcom-reviewers,nika https://hg.mozilla.org/integration/autoland/rev/5bfc1b8e4bbc Part 12: Add WrapNotNullUnchecked for NotNull<T*>. r=xpcom-reviewers,nika,jwalden https://hg.mozilla.org/integration/autoland/rev/35beba65da53 Part 13: Add specialization NotNull<T*> with MOZ_NONNULL_RETURN attributes. r=jwalden https://hg.mozilla.org/integration/autoland/rev/945f2b8355e7 Part 14: Add MOZ_NONNULL_RETURN attribute on NotNull::operator->. r=jwalden https://hg.mozilla.org/integration/autoland/rev/d313c99bc1a5 Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
See Also: → 1633144
Depends on: 1633809
No longer depends on: 1633809
Regressions: 1633809
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: