Skip to content

Instantly share code, notes, and snippets.

💭
🦀

Oliver Scherer oli-obk

💭
🦀
Block or report user

Report or block oli-obk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6bf4cd07b030d536830f1b94cc8e84c9
error: internal compiler error: src/librustc_traits/normalize_erasing_regions.rs:35: could not fully normalize `fn() -> usize {std::mem::size_of::<<Self as Trait>::Associated>}`
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:880:9
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /home/oli/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /home/oli/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.44/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
View shell.nix
with import<nixpkgs>{};
clangStdenv.mkDerivation{
name="name";
hardeningDisable=["all"];
buildInputs=[glibc_multi ccache cmake fish file gdb libedit libxml2 ncurses ninja python27 ripgrep swig which z3];
}
View gist:9d5ce1d69273c02706374997ecdd398f
DerFetzer/synapse-delegation
FauxFaux/septid
amir/epccn
aticu/ldpsc
autozimu/rust-mock-sample
bwinton/timemoji
carols10cents/cargo-open
casey/tokio-by-hand
cfiet/rust-advent-of-code-2018
cryptonote-rust/account
View gist:3d2805ec27201a2d7462a8907c4edce8
DerFetzer.synapse-delegation.eacb35c4ffb7ab13e3dc9543228222f93d789790
FauxFaux.septid.dcc4ac78017d5f2d9511934bd9bf60c18a57a9c6
amir.epccn.99b7ec67a2640b736a507f61257daea87ee43fdb
aticu.ldpsc.13beff18119e67a4f0d741144a56bb3ebade80f7
autozimu.rust-mock-sample.a4a068b092bdaf3978aecbfcd7646c21b391ec50
bwinton.timemoji.13118bd020ff897cd0607ae4edf51e95bce1a255
carols10cents.cargo-open.f50766a022c9ccf117d39f9cee8d37e8a5198ca0
casey.tokio-by-hand.d1ae672f1b508cb3383127cca10208f085bad42e
cfiet.rust-advent-of-code-2018.395b460f2409c48cf7fd4cfc82d8568624da24e8
cryptonote-rust.account.a05482ccd191259374fdc7ad7f1d1980863e003f
View gist:a730a9428d71e195dad67c0b3add3337
DerFetzer.synapse-delegation.eacb35c4ffb7ab13e3dc9543228222f93d789790
FauxFaux.septid.dcc4ac78017d5f2d9511934bd9bf60c18a57a9c6
amir.epccn.99b7ec67a2640b736a507f61257daea87ee43fdb
aticu.ldpsc.13beff18119e67a4f0d741144a56bb3ebade80f7
autozimu.rust-mock-sample.a4a068b092bdaf3978aecbfcd7646c21b391ec50
bwinton.timemoji.13118bd020ff897cd0607ae4edf51e95bce1a255
carols10cents.cargo-open.f50766a022c9ccf117d39f9cee8d37e8a5198ca0
casey.tokio-by-hand.d1ae672f1b508cb3383127cca10208f085bad42e
cfiet.rust-advent-of-code-2018.395b460f2409c48cf7fd4cfc82d8568624da24e8
View pre-const-qualif-mir.rs
// MIR for `main`
// source = MirSource { instance: Item(DefId(0/0:3 ~ test[317d]::main[0])), promoted: None }
// pass_name = QualifyAndPromoteConstants
// disambiguator = before
| User Type Annotations
| 0: Canonical { max_universe: U0, variables: [], value: Ty(&'static i32) } at test.rs:2:12: 2:24
| 1: Canonical { max_universe: U0, variables: [], value: Ty(&'static i32) } at test.rs:2:12: 2:24
|
fn main() -> () {
View gist.diff
34,41c34,42
< rustc_typeck::collect: zzz: 50: DefId(0/0:10 ~ atb[317d]::{{impl}}[0])
< rustc_typeck::collect: zzz: 50: DefId(0/0:11 ~ atb[317d]::{{impl}}[0]::AssocB[0])
< rustc_typeck::collect: zzz: 50: DefId(0/0:12 ~ atb[317d]::{{impl}}[1])
< rustc_typeck::collect: zzz: 50: DefId(0/0:13 ~ atb[317d]::a[0])
< rustc_typeck::collect: zzz: 51: DefId(0/0:13 ~ atb[317d]::a[0])
< rustc_typeck::collect: predicates_defined_on(DefId(0/0:13 ~ atb[317d]::a[0]))
< rustc_typeck::collect: explicit_predicates_of(def_id=DefId(0/0:13 ~ atb[317d]::a[0]))
< rustc_typeck::collect: predicates_defined_on: explicit_predicates_of(DefId(0/0:13 ~ atb[317d]::a[0])) = GenericPredicates([])
---
View proc_macro.dot
digraph G {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
build -> encounter
encounter -> load
build -> call
call -> expand
View gist:41cc65f0808b63d714ef2d74578f9f6c
#![feature(element_wise_initialization)]
// ignore-tidy-linelength
fn main() {
let _ = ((5, 6), [(1, 3), (4, 2)], "foo");
}
// END RUST SOURCE
// START rustc.main.SimplifyCfg-initial.after.mir
View impl Trait.md

impl Trait

Is the same syntax for both

  • anonymous generic parameters
  • inferred return types

E.g. in the function fn f<T: Trait1>(t: T, u: impl Trait2) -> impl Trait3 you have one named generic parameter, one anonymous generic parameter and a return type inferred from the function body.

You can’t perform that action at this time.