-
-
Save yvt/da205c5805b14f85c6c133c193b00485 to your computer and use it in GitHub Desktop.
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
#!/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 |
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
[package] | |
name = "lib1" | |
version = "0.1.0" | |
edition = "2018" | |
[dependencies] | |
lib2 = { path = "../lib2" } |
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 lib2::func_name; | |
pub const ARRAY: [u32; 4] = [0; 4]; | |
pub const A: () = func_name::<{ARRAY.as_ptr()}>(); | |
pub const B: () = func_name::<{ARRAY.as_ptr()}>(); |
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
[package] | |
name = "lib2" | |
version = "0.1.0" | |
edition = "2018" |
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(const_compare_raw_pointers)] | |
#![feature(const_generics)] | |
pub const fn func_name<const X: *const u32>() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment