Uh oh!
There was an error while loading. Please reload this page.
Rework stability annotation pass - #29083
Conversation
rust-highfive
commented
Oct 15, 2015
(rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Oct 16, 2015
Should be good for a rebase now! |
petrochenkov
commented
Oct 17, 2015
Rebased. |
petrochenkov
commented
Oct 17, 2015
|
petrochenkov
commented
Oct 17, 2015
Disregard the previous message. Everything will have to be annotated anyway when libcore root is stabilized. Better not to wait until that moment. |
alexcrichton
commented
Oct 20, 2015
I'm a little wary about using exported items because as you've found it's pretty lossy and requires annotating a little too much, but can you elaborate on how it deals with trait items differently? I'm always a little hazy on the difference between public and exported items, but it may just be a bug that trait items aren't listed as public. |
There was a problem hiding this comment.
This is actually intended to be stable (good that this PR caught the bug!), so could you tag it as stable since 1.0.0?
alexcrichton
commented
Oct 20, 2015
Also starting a crater run to see what the impact is (hopefully small!) |
alexcrichton
commented
Oct 21, 2015
Crater reports six regressions, 4 of which are legitimate and 2 of which seem unrelated but also legit? |
petrochenkov
commented
Oct 22, 2015
Sorry for the delay.
4 legitimately regressed crates are on unstable. Unstable 2 unrelated regressions look... completely unrelated. |
petrochenkov
commented
Oct 22, 2015
Trait items, impls and impl items are not public, but exported, so they can be left without annotations and therefore lead to "use of unmarked library feature" errors. We don't see these errors now, because the checking pass doesn't look at impls and impl items currently and all trait items have explicit or inherited stability by luck. The annotation overhead from using exported set is not so serious. It just looks large here, because everything is gathered in one commit. We have approximately 4000 annotated items and only 12 of them are "spurious". Statistically, almost nothing. On the other hand, it's certainly possible to extend the public set with exported trait items, impls and impl items. In fact, this was the first thing I did! But then I realized three things - 1) after this adjustment public set becomes suspiciously similar to the exported set, 2) I don't actually understand what the public set is supposed to be. 3) I'm still not sure if non-public exported traits (or their items, more importantly) need stability or not. So, I decided not to disrupt the public set with my extra additions, but to use the exported set instead. (It's interesting, that stability annotation pass was actually the only user of the public set besides rustdoc, everything else uses the exported set). |
petrochenkov
commented
Oct 23, 2015
In principle, annotation pass can build its own node set, or use exported set for everything except for traits and public set for traits, but it would be additional cruft for little gain, IMO. |
petrochenkov
commented
Oct 23, 2015
I'm currently annotating trait impls and various pieces of internal code keep requiring annotations :( |
petrochenkov
commented
Oct 23, 2015
Updated with annotations on trait impls. |
petrochenkov
commented
Oct 25, 2015
Blocked on #29291 |
bors
commented
Oct 25, 2015
☔ The latest upstream changes (presumably #29254) made this pull request unmergeable. Please resolve the merge conflicts. |
The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set. This is needed for #29083 because stability annotation pass uses the public set and all things listed above need to be annotated. Rustdoc can now be migrated to the public set as well, I guess. Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public. r? @alexcrichton or maybe someone else
alexcrichton
commented
Nov 3, 2015
@petrochenkov do you want to rebase this now that #29291 has landed? |
fcd0029 to
8357584Comparepetrochenkov
commented
Nov 17, 2015
Updated. |
alexcrichton
commented
Nov 17, 2015
@bors: r+ 8357584 |
bors
commented
Nov 18, 2015
⌛ Testing commit 8357584 with merge aa7132f... |
bors
commented
Nov 18, 2015
💔 Test failed - auto-win-gnu-32-opt |
8357584 to
e938e8eComparepetrochenkov
commented
Nov 18, 2015
Updated. |
alexcrichton
commented
Nov 18, 2015
@bors: r+ e938e8ea2eaf9093bb92abe25f550a48a4288441 |
bors
commented
Nov 18, 2015
⌛ Testing commit e938e8e with merge 9514f21... |
bors
commented
Nov 18, 2015
💔 Test failed - auto-linux-64-x-android-t |
e938e8e to
64b90f8Comparepetrochenkov
commented
Nov 18, 2015
Updated. |
alexcrichton
commented
Nov 18, 2015
@bors: r+ On Wed, Nov 18, 2015 at 10:17 AM, Vadim Petrochenkov <
|
bors
commented
Nov 18, 2015
📌 Commit 64b90f8 has been approved by |
What this patch does: - Stability annotations are now based on "exported items" supplied by rustc_privacy and not "public items". Exported items are as accessible for external crates as directly public items and should be annotated with stability attributes. - Trait impls require annotations now. - Reexports require annotations now. - Crates themselves didn't require annotations, now they do. - Exported macros are annotated now, but these annotations are not used yet. - Some useless annotations are detected and result in errors - Finally, some small bugs are fixed - deprecation propagates from stable deprecated parents, items in blocks are traversed correctly (fixes#29034) + some code cleanup.
bors
commented
Nov 18, 2015
bors
commented
Nov 18, 2015
This wasn't done in #29083 because attributes weren't parsed on fields of tuple variant back then. r? @alexcrichton
What this patch does: