You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caveat from the outset: The current ref-counting system will (or at least should) be replaced by a proper GC. I am fully aware of this, and I am fully aware that the test case below is making deliberate use of the ref-counting semantics.
Having said that... it still might be worth looking into this, since it might represent a bug in -Z extra-debug-info.
The bug is that the test below assert fails when compiled with -Z extra-debug-info:
% rustc a.rs && ./a
% rustc -Z extra-debug-info a.rs && ./a
warning: no debug symbols in executable (-arch x86_64)
task '<main>' failed at 'assertion failed: shared_count_at_outset == shared_count_at_finale', a.rs:29
I think sub is just an artifact of me cleaning up my original test case, which originally had the invocations of debug! and traverse_live_allocs invoked inline where we now have the invocations of sub.
(The fact that it is consuming and returning an ~Option<@int> is just an artifact of how I did that refactoring; I am pretty sure the problem described still occurs if you undo my refactoring and manually inline the body of sub into its call sites.)
…n, r=Manishearth
Fixesrust-lang#10609: Adds lint to detect construction of unit struct using `default`
Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name.
changelog: [`default_constructed_unit_structs`]: detects construction of unit structs using `default`
fixesrust-lang#10609
Caveat from the outset: The current ref-counting system will (or at least should) be replaced by a proper GC. I am fully aware of this, and I am fully aware that the test case below is making deliberate use of the ref-counting semantics.
Having said that... it still might be worth looking into this, since it might represent a bug in
-Z extra-debug-info
.The bug is that the test below assert fails when compiled with
-Z extra-debug-info
:The test (
a.rs
):The text was updated successfully, but these errors were encountered: