Skip to content

Instantly share code, notes, and snippets.

View panicbit's full-sized avatar
:shipit:
Ship it

panicbit

:shipit:
Ship it
  • Dortmund, Germany, ᐰ
View GitHub Profile
rustc -v -O -C code-model=kernel -C relocation-model=static --crate-type lib -o main.o --emit obj --extern kcore=/tmp/libkcore.rlib main.rs
main.rs:1:1: 1:1 error: duplicate entry for `const_ptr` [E01m52]
main.rs:1 #![feature(libc)]
^
main.rs:1:1: 1:1 help: run `rustc --explain E0152` to see a detailed explanation
main.rs:1:1: 1:1 error: duplicate entry for `mut_ptr` [E0152]
main.rs:1 #![feature(libc)]
^
main.rs:1:1: 1:1 help: run `rustc --explain E0152` to see a detailed explanation
main.rs:1:1: 1:1 error: duplicate entry for `i8` [E0152]
note: link against the following native artifacts when linking against this static library
note: the order and any duplication can be significant on some platforms, and so may need to be preserved
note: library: c
note: library: m
$ make
rustc -O -C code-model=kernel -C relocation-model=static --crate-type lib -o main.o --emit obj main.rs
make -C /lib/modules/4.2.3-1-ARCH/build M=$(HOME)/tmp/rust.ko modules
make[1]: Entering directory '/usr/lib/modules/4.2.3-1-ARCH/build'
CC [M] $(HOME)/tmp/rust.ko/stub.o
LD [M] $(HOME)/tmp/rust.ko/hello.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "_ZN6option13_$LT$impl$GT$6unwrap14_MSG_FILE_LINE20h8793f02bd16d261dX9ME" [$(HOME)/tmp/rust.ko/hello.ko] undefined!
WARNING: "_ZN9panicking5panic20h98c7cbfc94ff8f45EGKE" [$(HOME)/tmp/rust.ko/hello.ko] undefined!
WARNING: "__powidf2" [~/tmp/rust.ko/hello.ko] undefined!
WARNING: "__powisf2" [~/tmp/rust.ko/hello.ko] undefined!
WARNING: "fmod" [~/tmp/rust.ko/hello.ko] undefined!
WARNING: "fmodf" [~/tmp/rust.ko/hello.ko] undefined!
use std::cell::RefCell;
thread_local!(static DIR: RefCell<String> = RefCell::new(String::new()));
fn main() {
DIR.with(|f| {
f.borrow_mut().push_str("foobar");
});
DIR.with(|f| {
#[derive(Debug,Eq,PartialEq)]
struct Foo;
fn main() {
println!("{:?}", Foo);
println!("{:?}", Foo == Foo);
}
*int foo() {
int bar = 42;
return &bar;
}
#!/bin/bash
SUBREDDIT="winterporn"
MIN_WIDTH="1920"
MIN_HEIGHT="1080"
DLPATH="${HOME}/.cache/reddit_wallpaper"
if [ -z "$1" ]; then
NTH="0"
else
match *last_song {
None => println!("No song"),
Some(ref blah) => println!("{:?}", blah)
}
// cargo-deps: nom="~1.0.0"
#[macro_use]
extern crate nom;
use nom::*;
use nom::IResult::*;
use std::str::{self, FromStr};
use std::iter::FromIterator;
use std::collections::HashMap;