Skip to content

Instantly share code, notes, and snippets.

Alex Crichton alexcrichton

View GitHub Profile
View foo.rs
fn main() {
println!("{:?}", std::fs::read_to_string("./foo.rs"));
}
View bar.rs
extern crate foo;
pub fn bar() {
foo::foo();
}
View foo.diff
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index f93f3e72f8..10ad613329 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -831,14 +831,19 @@ impl<'a> Builder<'a> {
// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
// Force cargo to output binaries with disambiguating hashes in the name
- let metadata = if compiler.stage == 0 {
+ let mut metadata = if compiler.stage == 0 {
View foo.diff
diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs
index 0a51ec7d..05a5a656 100644
--- a/crates/js-sys/src/lib.rs
+++ b/crates/js-sys/src/lib.rs
@@ -1107,14 +1107,20 @@ pub fn try_iter(val: &JsValue) -> Result<Option<IntoIter>, JsValue> {
return Ok(None);
}
+ #[wasm_bindgen]
+ extern "C" {
View foo.diff
diff --git a/rayon-core/src/registry.rs b/rayon-core/src/registry.rs
index 63d8a31..ced0b9c 100644
--- a/rayon-core/src/registry.rs
+++ b/rayon-core/src/registry.rs
@@ -589,6 +589,13 @@ impl WorkerThread {
});
}
+ unsafe fn unset_current() {
+ WORKER_THREAD_STATE.with(|t| {
View lib.rs
use futures::sync::oneshot;
use futures::Future;
use js_sys::{Array, Error, Promise, Uint8ClampedArray, WebAssembly};
use rayon::prelude::*;
use std::cell::{RefCell, UnsafeCell};
use std::cmp;
use std::mem;
use std::rc::{Rc, Weak};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst};
use std::sync::{Arc, Mutex, MutexGuard};
View foo.diff
diff --git a/rustup-init.sh b/rustup-init.sh
index 3815d2f1..8411bfef 100755
--- a/rustup-init.sh
+++ b/rustup-init.sh
@@ -13,12 +13,12 @@
# install rustup. It just does platform detection, downloads the installer
# and runs it.
-set -u
-
View wut.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEEHJdcG7Rrr012HJ+q/6Zavl/fpDWbtZBAUcOy3X+Oc azure pipelines
View wut.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBC6+6fvw6mc7BWNL8I+aYLKR8TwZCUTv8HH6g0rfyE azure pipelines
View .tmux.conf
################################################################################
# Key Bindings
################################################################################
unbind C-b # unbind default prefix
set -g prefix C-s # make the new prefix control+s
bind -n C-k clear-history # Just a raw control+k clears history (like apple+k)
bind-key s send-prefix # Allow nested sessions by an extra key stroke
unbind C-o # rotates panes, but accidentally hit too often (o in vim)
You can’t perform that action at this time.