Skip to content

Commit

Permalink
re-export autodiff macro, fix nightly feature
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluis committed Nov 29, 2024
1 parent 78c6119 commit 9c56b95
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ publish = true
bench = false


[features] # 196/300 (104 remaining), 83 visible, 113 hidden
[features] # 197/300 (103 remaining), 84 visible, 113 hidden
# ==============================================================================
# https://doc.rust-lang.org/cargo/reference/features.html

Expand Down
2 changes: 1 addition & 1 deletion DOCS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The format is based on [Keep a Changelog], and this project adheres to
- items from: `core::{cell, num, ops, result}`, `std::{backtrace, fmt}`.
- fns: `array_from_fn`, `array_from_mut`, `array_from_ref`.
- macros:
- `compile_error`, `option_env`, `enumint`, `assert_unchecked!`, `format!`, `format_args!`, `concat`, `stringify`, `write!`, `writeln!`.
- `autodiff`, `compile_error`, `option_env`, `enumint`, `assert_unchecked!`, `format!`, `format_args!`, `concat`, `stringify`, `write!`, `writeln!`.
- wrapped: `env!`, as `env_!`, `vec!` as `vec_!`.
- structs:
- `NonZero`, `Saturating`, `Wrapping`, `OsStr`, `OsString`.
Expand Down
3 changes: 3 additions & 0 deletions src/code/reexports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ pub use devela_macros::{

/* `core` re-exports */

reexport! { rust: core::autodiff, extra_features: "nightly_autodiff",
doc: "Automatic Differentiation macro.", autodiff }

// source code
reexport! { rust: core,
doc: "Expands to the column number at which it was invoked.", @column as code_column }
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![cfg_attr(feature = "safe", forbid(unsafe_code))]
//
// nightly:
#![cfg_attr(feature = "nightly_autodiff", feature(auto_diff))]
#![cfg_attr(feature = "nightly_autodiff", feature(autodiff))]
#![cfg_attr(feature = "nightly_doc", feature(doc_cfg, doc_notable_trait))]
#![cfg_attr(all(feature = "nightly_doc", miri), allow(unused_attributes))]
#![cfg_attr(all(feature = "nightly_doc", not(doc)), allow(unused_attributes))]
Expand Down
3 changes: 2 additions & 1 deletion src/num/float/wrapper/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ macro_rules! custom_impls {
/// # Formula
/// $$ f'(x) \approx \frac{f(x + h) - f(x)}{h} $$
///
/// See also the [`autodiff`] attr macro, enabled with the `nightly_autodiff` feature.
/// See also the [`autodiff`][crate::autodiff] attr macro,
/// enabled with the `nightly_autodiff` feature.
///
/// [finite difference method]: https://en.wikipedia.org/wiki/Finite_difference_method
pub fn derivative<F>(f: F, x: $f, h: $f) -> Float<$f>
Expand Down

0 comments on commit 9c56b95

Please sign in to comment.