Move to stable, put LTO in cargo config

This commit is contained in:
Renar Narubin
2021-11-30 20:55:08 -08:00
parent 5a5289f43e
commit 29e232f7cf
6 changed files with 27 additions and 23 deletions

6
.cargo/config.toml Normal file
View File

@@ -0,0 +1,6 @@
[build]
rustflags = ["-Clinker-plugin-lto", "-Clinker=clang-13", "-Clink-arg=-fuse-ld=lld-13"]
rustdocflags = ["--cfg", "docsrs"]
[env]
CC = "clang-13"

View File

@@ -65,10 +65,9 @@ cc = "1"
criterion = { version = "0.3", features = ["html_reports"] } criterion = { version = "0.3", features = ["html_reports"] }
rand = "0.8" rand = "0.8"
[profile.test]
# run tests at high optimization to exercise typical codegen
opt-level = 3
[profile.release] [profile.release]
lto="thin" lto="thin"
codegen-units=1 codegen-units=1
[package.metadata.docs.rs]
all-features = true

View File

@@ -1 +1 @@
nightly-2021-11-03 1.56.1

View File

@@ -1,5 +1,5 @@
#![doc = include_str!("../README.md")] #![doc = include_str!("../README.md")]
#![feature(doc_cfg)] #![cfg_attr(docsrs, feature(doc_cfg))]
use core::{ use core::{
cmp, fmt, cmp, fmt,

View File

@@ -1,15 +1,4 @@
#![cfg(any(feature = "nalgebra-v021"))] #[cfg(any(feature = "nalgebra-v021", feature = "nalgebra-v029"))]
macro_rules! forward_fn_const {
($fast_ty:ident, $base_ty:ident
$(fn $fn_name:ident () -> Self ;)*) => {
$(
fn $fn_name () -> $fast_ty {
<$fast_ty>::new(<$base_ty>::$fn_name())
}
)*
}
}
macro_rules! impl_nalgebra { macro_rules! impl_nalgebra {
($($fast_ty:ident, $base_ty:ident),* ; ($($fast_ty:ident, $base_ty:ident),* ;
$nalgebra_version:path, $simba_version:path, $approx_version:path ; $nalgebra_version:path, $simba_version:path, $approx_version:path ;
@@ -226,8 +215,8 @@ macro_rules! impl_nalgebra {
fn min(self, other: Self) -> Self; fn min(self, other: Self) -> Self;
} }
forward_fn_const! { impl_nalgebra! {
$fast_ty, $base_ty @fn_consts $fast_ty, $base_ty
fn pi() -> Self ; fn pi() -> Self ;
fn two_pi() -> Self ; fn two_pi() -> Self ;
fn frac_pi_2() -> Self ; fn frac_pi_2() -> Self ;
@@ -366,10 +355,20 @@ macro_rules! impl_nalgebra {
} }
)* )*
}; };
(@fn_consts $fast_ty: ident, $base_ty: ident
$(fn $fn_name:ident () -> Self ;)*
) => {
$(
fn $fn_name () -> $fast_ty {
<$fast_ty>::new(<$base_ty>::$fn_name())
}
)*
};
} }
#[cfg(feature = "nalgebra-v021")] #[cfg(feature = "nalgebra-v021")]
#[doc(cfg(feature = "nalgebra-v021"))] #[cfg_attr(docsrs, doc(cfg(feature = "nalgebra-v021")))]
mod nalgebra_v021 { mod nalgebra_v021 {
macro_rules! real_field { macro_rules! real_field {
($fast_ty:ident, $base_ty:ident) => { ($fast_ty:ident, $base_ty:ident) => {
@@ -393,7 +392,7 @@ mod nalgebra_v021 {
} }
#[cfg(feature = "nalgebra-v029")] #[cfg(feature = "nalgebra-v029")]
#[doc(cfg(feature = "nalgebra-v029"))] #[cfg_attr(docsrs, doc(cfg(feature = "nalgebra-v029")))]
mod nalgebra_v029 { mod nalgebra_v029 {
macro_rules! real_field { macro_rules! real_field {
($fast_ty:ident, $base_ty:ident) => { ($fast_ty:ident, $base_ty:ident) => {

View File

@@ -1,5 +1,5 @@
#![cfg(feature = "num-traits")] #![cfg(feature = "num-traits")]
#![doc(cfg(feature = "num-traits"))] #![cfg_attr(docsrs, doc(cfg(feature = "num-traits")))]
use crate::{FF32, FF64}; use crate::{FF32, FF64};
use core::num::FpCategory; use core::num::FpCategory;