<p dir="auto">This is meant as a meta-bug for me to collect references to places where users complained about fallout from Sound Generic Drop (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="56708388" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21972" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/21972/hovercard" href="https://github.com/rust-lang/rust/pull/21972">#21972</a>) and its precursors (namely <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="55493878" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21657" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/21657/hovercard" href="https://github.com/rust-lang/rust/pull/21657">#21657</a> in particular).</p>
<p dir="auto">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.</p>
<p dir="auto">(I do not know where something like "borrow scopes should not always be lexical" (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="14199471" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/6393" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/6393/hovercard" href="https://github.com/rust-lang/rust/issues/6393">#6393</a>) falls in that categorization; that might be an example of something that would not require an RFC, but maybe it does at this point.)</p>
<hr>
<p dir="auto">Potential work items:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Make <code class="notranslate">Vec&lt;T&gt;</code>, <code class="notranslate">Box&lt;T&gt;</code>, <code class="notranslate">Rc&lt;T&gt;</code>, etc, covariant with respect to <code class="notranslate">T</code>.  Discussed on issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="54459958" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21198" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/21198/hovercard" href="https://github.com/rust-lang/rust/issues/21198">#21198</a> (was not a strict requirement for landing new destructor semantics).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Track even finer grained scopes, e.g. destruction order of temporary rvalues in an expression.  Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="57686841" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22323" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22323/hovercard" href="https://github.com/rust-lang/rust/issues/22323">#22323</a>
<ul dir="auto">
<li>fixed by non-lexical lifetimes (NLL), so <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pnkfelix/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pnkfelix">@pnkfelix</a> is choosing to check off its box here.</li>
</ul>
</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Implement refined Drop check rule that respects the side-condition "where T is a trait that has at least one <del>method</del> item" <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="70877055" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/24805" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/24805/hovercard" href="https://github.com/rust-lang/rust/issues/24805">#24805</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> uses of terms "superregion" and "subregion" suboptimal <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="57285548" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22171" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/22171/hovercard" href="https://github.com/rust-lang/rust/issues/22171">#22171</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> new scoping rules for safe dtors can yield spurious semi-colon or trailing unit expr <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="54255470" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21114" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/21114/hovercard" href="https://github.com/rust-lang/rust/issues/21114">#21114</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Temporary lifetimes sometimes yield surprising errors <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="278286308" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/46413" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/46413/hovercard" href="https://github.com/rust-lang/rust/issues/46413">#46413</a>
<ul dir="auto">
<li>(Note that with non-lexical lifetimes (NLL) enabled, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="278286308" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/46413" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/46413/hovercard" href="https://github.com/rust-lang/rust/issues/46413">#46413</a> is effectively a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="54255470" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/21114" data-hovercard-type="issue" data-hovercard-url="/rust-lang/rust/issues/21114/hovercard" href="https://github.com/rust-lang/rust/issues/21114">#21114</a>.)</li>
</ul>
</li>
</ul>
<hr>
<p dir="auto">key terms: destruction scope, block suffix, unsafe_destructor</p>
<p dir="auto">I'm using <code class="notranslate">libcore</code> and <code class="notranslate">liballoc</code> to build a freestanding kernel, and it used to work perfectly on 1.0.0-nightly (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/2b01a37ec38db9301239f0c0abcf3c695055b0ff/hovercard" href="https://github.com/rust-lang/rust/commit/2b01a37ec38db9301239f0c0abcf3c695055b0ff"><tt>2b01a37</tt></a> 2015-02-21).</p>
<p dir="auto">But since I updated my Rust and my <code class="notranslate">rust</code> submodule (including any dependencies) to the latest 1.0.0-nightly (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/c89de2c56baeb61e7cc434924dcc8bedd32b26b8/hovercard" href="https://github.com/rust-lang/rust/commit/c89de2c56baeb61e7cc434924dcc8bedd32b26b8"><tt>c89de2c</tt></a> 2015-03-28), I get a whole slew of these errors when building <code class="notranslate">liballoc</code> or anything that depends on it:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   Compiling alloc v0.0.1 (file:///home/virtlink/projects/alloctest/lib/liballoc)
src/lib.rs:1:1: 1:1 error: duplicate entry for `const_ptr` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `mut_ptr` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `i8` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT

...

src/lib.rs:1:1: 1:1 error: duplicate entry for `non_zero` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `debug_trait` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
error: aborting due to 58 previous errors
Could not compile `alloc`."><pre class="notranslate"><code class="notranslate">   Compiling alloc v0.0.1 (file:///home/virtlink/projects/alloctest/lib/liballoc)
src/lib.rs:1:1: 1:1 error: duplicate entry for `const_ptr` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `mut_ptr` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `i8` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT

...

src/lib.rs:1:1: 1:1 error: duplicate entry for `non_zero` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
src/lib.rs:1:1: 1:1 error: duplicate entry for `debug_trait` [E0152]
src/lib.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
             ^
error: aborting due to 58 previous errors
Could not compile `alloc`.
</code></pre></div>
<p dir="auto">I symlink <code class="notranslate">libcore</code> and <code class="notranslate">liballoc</code>, and add a <code class="notranslate">Cargo.toml</code> for each (see below). Here's a working reproduction of the issue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cargo new alloctest
cd alloctest
mkdir -p lib/libcore
mkdir -p lib/liballoc

git submodule add https://github.com/rust-lang/rust.git lib/rust
cd lib/rust
git checkout c89de2c56baeb61e7cc434924dcc8bedd32b26b8

cd ../libcore
ln -s ../rust/src/libcore/ src

cat &lt;&lt; EOF &gt; Cargo.toml
[package]
name = &quot;core&quot;
version = &quot;0.0.1&quot;
authors = [ &quot;some@example.com&quot; ]
EOF

cd ../liballoc
ln -s ../rust/src/liballoc/ src

cat &lt;&lt; EOF &gt; Cargo.toml
[package]
name = &quot;alloc&quot;
version = &quot;0.0.1&quot;
authors = [ &quot;some@example.com&quot; ]

[features]
external_funcs = []

[dependencies.core]
path = &quot;../libcore&quot;
EOF

cargo build"><pre class="notranslate"><code class="notranslate">cargo new alloctest
cd alloctest
mkdir -p lib/libcore
mkdir -p lib/liballoc

git submodule add https://github.com/rust-lang/rust.git lib/rust
cd lib/rust
git checkout c89de2c56baeb61e7cc434924dcc8bedd32b26b8

cd ../libcore
ln -s ../rust/src/libcore/ src

cat &lt;&lt; EOF &gt; Cargo.toml
[package]
name = "core"
version = "0.0.1"
authors = [ "some@example.com" ]
EOF

cd ../liballoc
ln -s ../rust/src/liballoc/ src

cat &lt;&lt; EOF &gt; Cargo.toml
[package]
name = "alloc"
version = "0.0.1"
authors = [ "some@example.com" ]

[features]
external_funcs = []

[dependencies.core]
path = "../libcore"
EOF

cargo build
</code></pre></div>