Closed
Description
Updated description
This code should be rejected from the compiler, but it is not:
trait Foo {}
struct A;
impl Foo for A {}
impl Drop for A {
fn drop(&mut self) { println!("dropping"); }
}
struct B<'a>(&'a Foo);
fn foo<'a>(a: &Foo) -> B<'a> { B(a) }
fn main() {
let _test = foo(&A);
println!("test");
}
Original Issue
Crash when reading from stdin
Depending on whether you let the compiler infer traits for you or not, you can make a program reading input from stdin crash in a couple different ways.
Repro here: https://gist.github.com/brandonw/3a3d040b7c6213740794
Metadata
Metadata
Assignees
Labels
No labels