This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# BasedOnStyle: LLVM | |
AccessModifierOffset: -4 | |
ConstructorInitializerIndentWidth: 4 | |
AlignEscapedNewlinesLeft: false | |
AlignTrailingComments: true | |
AllowAllParametersOfDeclarationOnNextLine: true | |
AllowShortIfStatementsOnASingleLine: false | |
AllowShortLoopsOnASingleLine: false | |
AlwaysBreakTemplateDeclarations: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustc --crate-type=dylib foo.rs | |
rustc caller.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static str: &'static [u8] = b"Hello\0"; | |
#[repr(C)] | |
pub struct Foo { | |
ptr: *const i8 | |
} | |
#[no_mangle] | |
pub extern "C" fn new_foo() -> Foo { | |
Foo { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::File; | |
fn main() { | |
let args = ::std::os::args(); | |
let string = &args[1]; | |
let replace = &args[2]; | |
let path = &args[3]; | |
assert!(replace.len() == string.len()); | |
println!("Replacing`{}` with `{}` in `{}`...", string, replace, path); | |
let chars: Vec<char> = string.as_slice().chars().collect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ```rust | |
/// use crusty_chip::{ DISPLAY_WIDTH, VirtualMachine }; | |
/// // Dump the pixels to stdout | |
/// fn dump_pixels(pixels: &[u8]) { | |
/// for (i, px) in pixels.iter().enumerate() { | |
/// match *px { | |
/// 0 => print!(" "), | |
/// _ => print!("#") | |
/// } | |
/// if i % DISPLAY_WIDTH == 0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- iter.s 2015-05-14 21:14:02.496673255 +0200 | |
+++ while.s 2015-05-14 21:13:58.676673077 +0200 | |
@@ -1,9 +1,9 @@ | |
.text | |
- .file "iter.0.rs" | |
- .section .text._ZN4main20h5cb52da90a7daa0eeaaE,"ax",@progbits | |
+ .file "while.0.rs" | |
+ .section .text._ZN4main20hfa1625d262a55eb2eaaE,"ax",@progbits | |
.align 16, 0x90 | |
- .type _ZN4main20h5cb52da90a7daa0eeaaE,@function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(test, clone_from_slice)] | |
extern "C" { | |
fn memcpy(dest: *mut libc::c_void, src: *const libc::c_void, n: libc::size_t) -> *mut libc::c_void; | |
} | |
extern crate test; | |
extern crate libc; | |
const TEXT: &'static [u8] = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate md5; | |
fn find_number<F: Fn(md5::Digest) -> bool>(key: &str, predicate: F) -> u32 { | |
for n in 0.. { | |
let s = format!("{}{}", key, n); | |
let digest = md5::compute(s.as_bytes()); | |
if predicate(digest) { | |
return n; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[xcb] Unknown request in queue while dequeuing | |
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called | |
[xcb] Aborting, sorry about that. | |
NoLifeClient: xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed. | |
The program has unexpectedly finished. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In file included from /usr/include/c++/4.8.1/bits/atomic_base.h:36:0, | |
from /usr/include/c++/4.8.1/atomic:41, | |
from /home/snake/projects/NoLifeStory/NoLifeClient/NoLifeClient.hpp:32, | |
from /home/snake/projects/NoLifeStory/NoLifeClient/Sprite.cpp:18: | |
/home/snake/projects/NoLifeStory/NoLifeClient/Sprite.cpp:26:38: error: use of deleted function 'std::atomic<bool>::atomic(const std::atomic<bool>&)' | |
atomic<bool> ThreadContextMade = false; | |
^ | |
In file included from /home/snake/projects/NoLifeStory/NoLifeClient/NoLifeClient.hpp:32:0, | |
from /home/snake/projects/NoLifeStory/NoLifeClient/Sprite.cpp:18: | |
/usr/include/c++/4.8.1/atomic:487:7: error: declared here |
OlderNewer