Skip to content

Instantly share code, notes, and snippets.

@Diggsey
Created May 10, 2015 04:29
Show Gist options
  • Save Diggsey/918741dc79e98762ee0a to your computer and use it in GitHub Desktop.
Save Diggsey/918741dc79e98762ee0a to your computer and use it in GitHub Desktop.
#![feature(no_std)]
#![no_std]
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(scoped_tls)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
struct TestStruct;
#[allow(non_snake_case)]
mod TEST_STRUCT {
#[prelude_import]
use std::prelude::v1::*;
pub struct Ty;
}
unsafe impl <'scope> ::std::thread::WithLifetime<'scope> for TEST_STRUCT::Ty {
type
Result
=
&'scope TestStruct;
}
static TEST_STRUCT: ::std::thread::ScopedKey<TEST_STRUCT::Ty> =
{
use std::thread::ScopedKey as __Key;
#[cfg(any(windows,
target_os = "android",
target_os = "ios",
target_os = "openbsd",
target_arch = "aarch64"))]
const _INIT: __Key<TEST_STRUCT::Ty> =
__Key{inner:
::std::thread::__scoped::KeyInner{inner:
::std::thread::__scoped::OS_INIT,
marker:
::std::marker::PhantomData::<::std::cell::UnsafeCell<<TEST_STRUCT::Ty
as
::std::thread::WithLifetime<'static>>::Result>>,},};
_INIT
};
pub fn main() { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment