Skip to content

Instantly share code, notes, and snippets.

View pnkfelix's full-sized avatar
🍩
re-pat; ex-🥐

Felix S Klock II pnkfelix

🍩
re-pat; ex-🥐
View GitHub Profile
@pnkfelix
pnkfelix / gist:6579745
Created September 16, 2013 11:58
issue 9129 backtrace
Starting program: /Users/fklock/Documents/WorkLog/issue9129/break/fold-code
Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to process 22439 thread 0x1203]
0x0000000100000b4e in on_break_expr::hf989864e362185ce::v0.0 ()
(gdb) c
Continuing.
Breakpoint 3, 0x0000000100001ac0 in on_break_expr::anon::expr_fn::a4 ()
(gdb) c
go: fold-code3
./$<
fold-code3.s: fold-code3.no-opt.ll
llc -filetype=asm -O0 $<
fold-code3.no-opt.o: fold-code3.no-opt.ll
llc -filetype=obj -O0 $<
GCC_LINK_ARGS= -L/Users/fklock/Dev/Mozilla/rust.git/objdir-dbgopt/x86_64-apple-darwin/stage2/lib/rustc/x86_64-apple-darwin/lib -m64 \
% cat /tmp/b.rs
struct Concrete { name: ~str }
impl Concrete {
fn name(&self) -> ~str { ~"Concrete: "+self.name }
}
trait Nam { fn name(&self) -> ~str; }
trait Nym { fn name(&self) -> ~str; }
@pnkfelix
pnkfelix / gist:6702110
Created September 25, 2013 16:19
diff to privacy.rs
% git diff --cached
diff --git a/src/librustc/middle/privacy.rs b/src/librustc/middle/privacy.rs
index 3c60bd6..90ccb36 100644
--- a/src/librustc/middle/privacy.rs
+++ b/src/librustc/middle/privacy.rs
@@ -46,9 +46,7 @@ use syntax::ast::{_mod,Expr,item,Block,Pat};
// items leading down to the current item (excluding an `impl`) must be `pub`.
pub type ExportedItems = HashSet<NodeId>;
-type Context<'self> = (&'self method_map, &'self ExportMap2);
// Issue 2634
// Better explanations for why non-implicitly copyable things are that way.
use NC = std::util::NonCopyable;
mod NonCopyExamples {
use NC = std::util::NonCopyable;
pub struct S { a: int, nc: NC }
pub struct T { a: int, own: ~int }
pub struct U<'self> { a: int, mu: &'self mut int }
@pnkfelix
pnkfelix / gist:6892686
Last active December 25, 2015 01:09
`-Z debug-info -Z extra-debug-info` applied to a rustc bootstrap
00-07-04 rust.git/objdir-dbgdbg (git:moz-master) % make
cfg: build triple x86_64-apple-darwin
cfg: host triples x86_64-apple-darwin
cfg: target triples x86_64-apple-darwin
cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: enabling dwarf info for rustc and libs (CFG_ENABLE_DEBUGDEBUG)
cfg: host for x86_64-apple-darwin is x86_64
cfg: os for x86_64-apple-darwin is apple-darwin
cfg: using ccache clang
@pnkfelix
pnkfelix / gist:6905109
Created October 9, 2013 17:38
Original bug report for Rust Issue 7331 : https://github.com/mozilla/rust/issues/7331

I tried and failed to strip it down, but the code

// Copyright 2013 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
-*- mode: ack; default-directory: "~/Dev/Mozilla/rust-gc/src/" -*-
Ack started at Tue Oct 15 10:35:34
ack '#\[[^()]*=[^()]*\]'
compiletest/compiletest.rc
11:#[crate_type = "bin"];
etc/combine-tests.py
44: c.write("#[path = \"%s\"]" % p);

Rust circa v0.8:

attr : '#' '[' attr_list ']' ;
attr_list : attr [ ',' attr_list ]*
attr : ident [ '=' literal
             | '(' attr_list ')' ] ? ;

Niko proposal 1:

foobar3asm.rs:447:20: 447:21 error: expected ident, found `{`
foobar3asm.rs:447 asm!{"int3"};
^