Skip to content

Instantly share code, notes, and snippets.

@yvt

yvt/extract.sh Secret

Created June 8, 2020 10:46
Show Gist options
  • Save yvt/2fec54f8012d512c59216b5d2ef82d63 to your computer and use it in GitHub Desktop.
Save yvt/2fec54f8012d512c59216b5d2ef82d63 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Because Gist doesn't support subdirectories...
mkdir -p lib1/src
mkdir -p lib2/src
mv lib1-src-lib.rs lib1/src/lib.rs
mv lib1-Cargo.toml lib1/Cargo.toml
mv lib2-src-lib.rs lib2/src/lib.rs
mv lib2-Cargo.toml lib2/Cargo.toml
[package]
name = "lib1"
version = "0.1.0"
edition = "2018"
[dependencies]
lib2 = { path = "../lib2" }
fn unused_function(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {}
[package]
name = "lib2"
version = "0.1.0"
edition = "2018"
#![feature(const_generics)]
pub trait TypeFn {
type Output;
}
pub struct GenericType<const B: i8>;
// Removing braces around `42` resolves the crash
impl TypeFn for GenericType<{ 42 }> {
type Output = ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment