Skip to content

Commit

Permalink
Fix several issues
Browse files Browse the repository at this point in the history
- Fix warning when multiple keywords are used.
- Export Builder in prelude if multi-rt is enabled.
- Add references to tutorial.
- Make jl-sys depend on jlrs-macros to improve error message when no version feature is enabled
  • Loading branch information
Taaitaaiger committed Sep 20, 2024
1 parent e1b86b1 commit d81388f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ are actively tested. Using the current stable version of Julia is highly recomme
supported Rust version is currently 1.77.

This readme only contains information about what features are supported by jlrs, what
prerequisites must be met, and how to meet them. For information and examples about how to use
jlrs, please read the [docs](https://docs.rs/jlrs). The documentation assumes you are already
familiar with the Julia and Rust programming languages.
prerequisites must be met, and how to meet them. A complete tutorial is available
[here](https://taaitaaiger.github.io/jlrs-tutorial/). For more information and examples about how
to use jlrs, please read the [docs](https://docs.rs/jlrs). All documentation assumes you are
already familiar with the Julia and Rust programming languages.


## Overview
Expand Down
15 changes: 8 additions & 7 deletions jl_sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ links = "julia"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
julia-1-6 = []
julia-1-7 = []
julia-1-8 = []
julia-1-9 = []
julia-1-10 = []
julia-1-11 = []
julia-1-12 = []
julia-1-6 = ["jlrs-macros/julia-1-6"]
julia-1-7 = ["jlrs-macros/julia-1-7"]
julia-1-8 = ["jlrs-macros/julia-1-8"]
julia-1-9 = ["jlrs-macros/julia-1-9"]
julia-1-10 = ["jlrs-macros/julia-1-10"]
julia-1-11 = ["jlrs-macros/julia-1-11"]
julia-1-12 = ["jlrs-macros/julia-1-12"]

fast-tls = []
lto = []
Expand All @@ -40,6 +40,7 @@ docs = ["julia-1-12"]
[build-dependencies]
cc = "1"
cfg-if = "1"
jlrs-macros = { path = "../jlrs_macros", version = "0.4"}

[package.metadata.docs.rs]
features = ["docs"]
10 changes: 5 additions & 5 deletions jlrs/src/data/managed/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ macro_rules! named_tuple {
};
($frame:expr, $name:expr => $value:expr, $($rest:tt)+) => {
{
const n: usize = $crate::count!($($rest)+);
let mut pairs: [::std::mem::MaybeUninit::<($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value)>; n] = [::std::mem::MaybeUninit::uninit(); n];
const N: usize = $crate::count!($($rest)+);
let mut pairs: [::std::mem::MaybeUninit::<($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value)>; N] = [::std::mem::MaybeUninit::uninit(); N];
let name = $crate::convert::to_symbol::ToSymbol::to_symbol(&$name, &$frame);

pairs[0].write((name, $value));
Expand All @@ -105,10 +105,10 @@ macro_rules! named_tuple {
let name = $crate::convert::to_symbol::ToSymbol::to_symbol(&$name, &$frame);
$pairs[$i].write((name, $value));

let pairs: &[($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value); n] = unsafe {
let pairs: &[($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value); N] = unsafe {
::std::mem::transmute::<
&[::std::mem::MaybeUninit::<($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value)>; n],
&[($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value); n]
&[::std::mem::MaybeUninit::<($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value)>; N],
&[($crate::data::managed::symbol::Symbol, $crate::data::managed::value::Value); N]
>($pairs)
};

Expand Down
1 change: 1 addition & 0 deletions jlrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! are actively tested. Using the current stable version of Julia is highly recommended. The
//! minimum supported Rust version is currently 1.77.
//!
//! A tutorial is available [here](https://taaitaaiger.github.io/jlrs-tutorial/).
//!
//! # Overview
//!
Expand Down
2 changes: 1 addition & 1 deletion jlrs/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use jlrs_macros::{

#[cfg(any(feature = "local-rt", feature = "async-rt", feature = "ccall"))]
pub use crate::memory::stack_frame::StackFrame;
#[cfg(any(feature = "async-rt", feature = "local-rt"))]
#[cfg(any(feature = "async-rt", feature = "local-rt", feature = "multi-rt"))]
pub use crate::runtime::builder::Builder;
#[cfg(feature = "tokio-rt")]
pub use crate::runtime::executor::tokio_exec::*;
Expand Down

0 comments on commit d81388f

Please sign in to comment.