-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(toolchain): bump rust toolchain + simple Nix
- Loading branch information
bhoudebert
committed
Oct 27, 2022
1 parent
0b4409b
commit 07540a8
Showing
15 changed files
with
128 additions
and
50 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
flake-profile-1-link |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nix/store/gm8yax6xam8bx7zmacvnykxya3f5s247-rust-function_name-env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
use ::function_name::named; | ||
|
||
#[named] | ||
fn my_super_duper_function () | ||
{ | ||
fn my_super_duper_function() { | ||
dbg!(function_name!()); | ||
} | ||
|
||
fn main () | ||
{ | ||
fn main() { | ||
my_super_duper_function(); | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#[macro_use] extern crate function_name; | ||
#[macro_use] | ||
extern crate function_name; | ||
|
||
macro_rules! function_path {() => (concat!( | ||
module_path!(), "::", function_name!() | ||
))} | ||
macro_rules! function_path { | ||
() => { | ||
concat!(module_path!(), "::", function_name!()) | ||
}; | ||
} | ||
|
||
pub mod foo { | ||
pub mod bar { | ||
#[named] | ||
pub fn baz () | ||
{ | ||
pub fn baz() { | ||
dbg!(function_path!()); | ||
} | ||
} | ||
} | ||
|
||
fn main () | ||
{ | ||
fn main() { | ||
foo::bar::baz(); | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
description = "Rust Function Name"; | ||
|
||
inputs = { | ||
utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, utils }: | ||
utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
{ | ||
packages.${system}.default = pkgs.stdenv.mkDerivation { | ||
name = "rust-function_name"; | ||
src = self; | ||
}; | ||
devShells.default = import ./shell.nix { inherit pkgs; }; | ||
} | ||
); | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.45.0 | ||
1.64.0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tab_spaces = 4 | ||
edition = "2021" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
let | ||
in | ||
with pkgs; | ||
|
||
stdenv.mkDerivation { | ||
name = "rust-function_name"; | ||
buildInputs = [ | ||
## Rust | ||
cargo | ||
rustup | ||
rustc | ||
pkg-config | ||
openssl | ||
openssl.dev | ||
llvm | ||
wllvm | ||
rust-bindgen | ||
rust-analyzer | ||
rustfmt | ||
# extra tools | ||
cargo-audit | ||
cargo-edit | ||
cargo-outdated | ||
cargo-watch | ||
## Nix | ||
nixpkgs-fmt | ||
]; | ||
# OPENSSL_DEV=openssl.dev; | ||
# IS_DEV=1; | ||
RUST_LOG = "info"; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ extern crate function_name; | |
|
||
#[test] | ||
#[named] | ||
fn r#if () | ||
{ | ||
fn r#if() { | ||
assert_eq!(function_name!(), "r#if"); | ||
} |