about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-04-28 17:47:16 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-04-28 17:47:16 +0200
commitb892264ea4f048feb5f380d3e659d82ba463f5b7 (patch)
tree31076c11488b4ec5e43a584b7db33d4d6bd30e20 /src/libstd/sys/unix/stack_overflow.rs
parentda2276e293359708b62bb489801cb9872d19d32f (diff)
downloadrust-b892264ea4f048feb5f380d3e659d82ba463f5b7.tar.gz
rust-b892264ea4f048feb5f380d3e659d82ba463f5b7.zip
Fix #24895.
[breaking-change]

What does this break?  Basically, code that implements `Drop` and is
using `T:Copy` for one of its type parameters and is relying on the
Drop Check rule not applying to it.

Here is an example:

```rust
#![allow(dead_code,unused_variables,unused_assignments)]
struct D<T:Copy>(T);
impl<T:Copy> Drop for D<T> { fn drop(&mut self) { } }

trait UserT { fn c(&self) { } }
impl<T:Copy> UserT for T { }
struct E<T:UserT>(T);
impl<T:UserT> Drop for E<T> { fn drop(&mut self) { } }

// This one will start breaking.
fn foo() { let (d2, d1); d1 = D(34); d2 = D(&d1); }

#[cfg(this_one_does_and_should_always_break)]
fn bar() { let (e2, e1); e1 = E(34); e2 = E(&e1); }

fn main() {
    foo();
}
```
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions