We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use std::num::Float; struct Point {x: f64, y: f64} fn compute_distance(p1: &Point, p2: &Point) -> f64 { let x_d = p1.x - p2.x; let y_d = p1.y - p2.y; Float::sqrt(x_d * x_d + y_d * y_d) } fn main() { let on_the_stack : Point = Point {x: 3.0, y: 4.0}; let on_the_heap : Box<Point> = box Point {x: 7.0, y: 9.0}; compute_distance(&on_the_stack, &*on_the_heap); }
sun@sun:~/Desktop/Rust$ RUST_BACKTRACE=1 rustc reference_lifetime.rs error: internal compiler error: unexpected failure note: the compiler hit an unexpected failure path. this is a bug. note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html note: run with `RUST_BACKTRACE=1` for a backtrace task 'rustc' failed at 'assertion failed: `(left == right) && (right == left)` (left: `3`, right: `0`)', /home/sun/rust/src/librustc/middle/trans/callee.rs:528 stack backtrace: 1: 0xb61f3c80 - rt::backtrace::imp::write::h8e87d0f1c0e6314eOcq 2: 0xb61f6b80 - failure::on_fail::hd69e89a09fe1c193byq 3: 0xb656edd0 - unwind::begin_unwind_inner::h8024dabe9217e622Axd 4: 0xb656e9f0 - unwind::begin_unwind_fmt::he2b10618cd8e2a3b2ud 5: 0xb6af3910 - middle::trans::callee::trans_fn_ref_with_substs::h35ded8d4791617efGC3 6: 0xb6af17a0 - middle::trans::callee::trans_fn_ref::h6fb7a7f230364cc9wq3 7: 0xb6afa3d0 - middle::trans::callee::trans_call::closure.122313 8: 0xb6ad10f0 - middle::trans::callee::trans_call_inner::hb58abead86d536f4qY3 9: 0xb6afa140 - middle::trans::callee::trans_call::h1afd80801dd261bfKS3 10: 0xb6b09d60 - middle::trans::expr::trans_rvalue_dps_unadjusted::hd623d2ee101663f1365 11: 0xb6ac8780 - middle::trans::expr::trans_into::hfbee30f25eca9fb7BI4 12: 0xb6ac8bf0 - middle::trans::controlflow::trans_block::h1bd514ecdbd0e95bRY0 13: 0xb6b77750 - middle::trans::base::trans_closure::h6be5203281e95063V4g 14: 0xb6aba540 - middle::trans::base::trans_fn::hfdfc7543375f42e2jgh 15: 0xb6ab7540 - middle::trans::base::trans_item::h4c0dbd6cae5d4359Czh 16: 0xb6b82ac0 - middle::trans::base::trans_crate::h5d3949c27f22bd3dtxi 17: 0xb6ff9dc0 - driver::driver::phase_4_translate_to_llvm::h2473848275bafe8d6yA 18: 0xb6ff1030 - driver::driver::compile_input::hcf3ef773b2081d8f05z 19: 0xb707bc80 - driver::run_compiler::hf7e21306399a9813bTD 20: 0xb707bb30 - driver::run::closure.144861 21: 0xb6745ee0 - task::TaskBuilder<S>::try_future::closure.103260 22: 0xb6745cc0 - task::TaskBuilder<S>::spawn_internal::closure.103231 23: 0xb76d81b0 - task::NativeSpawner.Spawner::spawn::closure.8437 24: 0xb656e790 - unwind::try::try_fn::h9de4ea0e925684b3tod 25: 0xb65d7700 - rust_try_inner 26: 0xb65d76c0 - rust_try 27: 0xb656c770 - unwind::try::h30a13c8b3633dc23imd 28: 0xb656c5e0 - task::Task::run::hd3b288cf5211df4eWBc 29: 0xb76d7f30 - task::NativeSpawner.Spawner::spawn::closure.8377 30: 0xb656de90 - thread::thread_start::h22611edb92a890cf7Vc 31: 0xb60c9e40 - start_thread 32: 0xb64649f2 - clone 33: 0x0 - <unknown>
Version
sun@sun:~/Desktop/Rust$ rustc -v rustc 0.13.0-dev (96991e933 2014-10-22 23:57:11 +0000)
System
No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.10 Release: 14.10 Codename: utopic
The text was updated successfully, but these errors were encountered:
Here's a minimal program that results in the exactly same assertion failure (with slight difference in the backtrace):
fn main() { std::os::args().as_slice().head().map(Clone::clone); }
I'm using the exactly same rustc version and Ubuntu 14.10 64-bit.
Sorry, something went wrong.
Looks like a duplicate of #18061
Thanks @bkoropoff
No branches or pull requests
Version
System
The text was updated successfully, but these errors were encountered: