/src/test/auxiliary/weak-lang-items.rs

https://gitlab.com/pranith/rust · Rust · 36 lines · 16 code · 8 blank · 12 comment · 1 complexity · f458464008794129538fcd742f0f0eea MD5 · raw file

  1. // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
  2. // file at the top-level directory of this distribution and at
  3. // http://rust-lang.org/COPYRIGHT.
  4. //
  5. // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
  6. // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
  7. // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
  8. // option. This file may not be copied, modified, or distributed
  9. // except according to those terms.
  10. // no-prefer-dynamic
  11. // This aux-file will require the eh_personality function to be codegen'd, but
  12. // it hasn't been defined just yet. Make sure we don't explode.
  13. #![feature(no_std, core)]
  14. #![no_std]
  15. #![crate_type = "rlib"]
  16. #[macro_use]
  17. extern crate core;
  18. struct A;
  19. impl core::ops::Drop for A {
  20. fn drop(&mut self) {}
  21. }
  22. pub fn foo() {
  23. let _a = A;
  24. panic!("wut");
  25. }
  26. mod std {
  27. pub use core::{option, fmt};
  28. }