Skip to content

Commit 4da9f1d

Browse files
authored
Fix build (#915)
1 parent 037947e commit 4da9f1d

File tree

21 files changed

+46
-47
lines changed

21 files changed

+46
-47
lines changed

crates/rune-alloc/src/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
491491
/// ```
492492
///
493493
/// [memory layout]: self#memory-layout
494-
/// [`Layout`]: crate::Layout
494+
/// [`Layout`]: core::alloc::Layout
495495
#[inline]
496496
pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self {
497497
Self {

crates/rune-alloc/src/hashbrown/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6877,7 +6877,7 @@ where
68776877
let reserve = if self.is_empty() {
68786878
iter.size_hint().0
68796879
} else {
6880-
(iter.size_hint().0 + 1) / 2
6880+
iter.size_hint().0.div_ceil(2)
68816881
};
68826882

68836883
self.try_reserve(reserve)?;

crates/rune-alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#![cfg_attr(rune_nightly, feature(core_intrinsics))]
4444
#![cfg_attr(rune_nightly, feature(dropck_eyepatch))]
4545
#![cfg_attr(rune_nightly, feature(min_specialization))]
46-
#![cfg_attr(rune_nightly, feature(ptr_sub_ptr))]
4746
#![cfg_attr(rune_nightly, feature(slice_range))]
4847
#![cfg_attr(rune_nightly, feature(rustc_attrs))]
4948
#![allow(clippy::comparison_chain)]

crates/rune-alloc/src/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cfg_if! {
6363
if #[cfg(rune_nightly)] {
6464
#[inline(always)]
6565
pub(crate) unsafe fn sub_ptr<T>(from: *const T, to: *const T) -> usize {
66-
from.sub_ptr(to)
66+
from.offset_from_unsigned(to)
6767
}
6868
} else {
6969
#[inline(always)]

crates/rune-alloc/src/vec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3038,7 +3038,7 @@ impl<T, A: Allocator> TryExtend<T> for Vec<T, A> {
30383038

30393039
#[cfg(feature = "std")]
30403040
fn io_err(error: Error) -> std::io::Error {
3041-
std::io::Error::new(std::io::ErrorKind::Other, error)
3041+
std::io::Error::other(error)
30423042
}
30433043

30443044
#[cfg(feature = "std")]

crates/rune-core/src/item/internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(super) fn write_tag<A: Allocator>(
6060
return Err(alloc::Error::CapacityOverflow);
6161
}
6262

63-
let n = u16::try_from(n << TYPE_BITS | tag).expect("tag out of bounds");
63+
let n = u16::try_from((n << TYPE_BITS) | tag).expect("tag out of bounds");
6464
let buf = n.to_ne_bytes();
6565
output.try_extend_from_slice(&buf[..])?;
6666
Ok(())

crates/rune-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rune-macros = { version = "=0.14.0", path = "../rune-macros" }
1919
rune-modules = { version = "0.14.0", path = "../rune-modules", features = ["core", "test", "json", "toml", "rand"] }
2020

2121
serde = { version = "1.0.163", features = ["derive"] }
22-
wasm-bindgen = { version = "0.2.85", features = ["serde-serialize"] }
22+
wasm-bindgen = { version = "0.2.100", features = ["serde-serialize"] }
2323
wasm-bindgen-futures = "0.4.35"
2424
js-sys = "0.3.62"
2525
anyhow = "1.0.71"

crates/rune/src/compile/context_error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl fmt::Display for ContextError {
194194
"Error when building associated constant in {container}::{kind}: {error}"
195195
)?;
196196
}
197-
ContextError::UnitAlreadyPresent {} => {
197+
ContextError::UnitAlreadyPresent => {
198198
write!(f, "Unit `()` type is already present")?;
199199
}
200200
ContextError::InternalAlreadyPresent { name } => {
@@ -358,7 +358,7 @@ impl fmt::Display for ContextError {
358358
ContextError::MissingVariant { index, type_info } => {
359359
write!(f, "Missing variant {index} for `{type_info}`")?;
360360
}
361-
ContextError::ExpectedAssociated {} => {
361+
ContextError::ExpectedAssociated => {
362362
write!(f, "Expected associated function")?;
363363
}
364364
ContextError::TypeHashMismatch {

crates/rune/src/compile/meta.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ impl Meta {
127127
Kind::Function { .. } => Some(self.hash),
128128
Kind::Closure { .. } => Some(self.hash),
129129
Kind::AsyncBlock { .. } => Some(self.hash),
130-
Kind::Const { .. } => None,
131-
Kind::ConstFn { .. } => None,
130+
Kind::Const => None,
131+
Kind::ConstFn => None,
132132
Kind::Macro => None,
133133
Kind::AttributeMacro => None,
134134
Kind::Import { .. } => None,

crates/rune/src/compile/meta_info.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ impl MetaInfoKind {
129129
} => MetaInfoKind::Struct,
130130
meta::Kind::Struct { .. } => MetaInfoKind::Variant,
131131
meta::Kind::Enum { .. } => MetaInfoKind::Enum,
132-
meta::Kind::Macro { .. } => MetaInfoKind::Macro,
133-
meta::Kind::AttributeMacro { .. } => MetaInfoKind::AttributeMacro,
132+
meta::Kind::Macro => MetaInfoKind::Macro,
133+
meta::Kind::AttributeMacro => MetaInfoKind::AttributeMacro,
134134
meta::Kind::Function {
135135
associated: None, ..
136136
} => MetaInfoKind::Function,
@@ -140,12 +140,12 @@ impl MetaInfoKind {
140140
} => MetaInfoKind::Associated,
141141
meta::Kind::Closure { .. } => MetaInfoKind::Closure,
142142
meta::Kind::AsyncBlock { .. } => MetaInfoKind::AsyncBlock,
143-
meta::Kind::Const { .. } => MetaInfoKind::Const,
144-
meta::Kind::ConstFn { .. } => MetaInfoKind::ConstFn,
143+
meta::Kind::Const => MetaInfoKind::Const,
144+
meta::Kind::ConstFn => MetaInfoKind::ConstFn,
145145
meta::Kind::Import { .. } => MetaInfoKind::Import,
146146
meta::Kind::Alias { .. } => MetaInfoKind::Alias,
147-
meta::Kind::Module { .. } => MetaInfoKind::Module,
148-
meta::Kind::Trait { .. } => MetaInfoKind::Trait,
147+
meta::Kind::Module => MetaInfoKind::Module,
148+
meta::Kind::Trait => MetaInfoKind::Trait,
149149
}
150150
}
151151
}

crates/rune/src/compile/unit_builder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl UnitBuilder {
645645
)
646646
.with_span(span)?;
647647
}
648-
meta::Kind::Const { .. } => {
648+
meta::Kind::Const => {
649649
let Some(const_value) = query.get_const_value(meta.hash) else {
650650
return Err(compile::Error::msg(
651651
span,
@@ -659,16 +659,16 @@ impl UnitBuilder {
659659
.try_insert(meta.hash, value)
660660
.with_span(span)?;
661661
}
662-
meta::Kind::Macro { .. } => (),
663-
meta::Kind::AttributeMacro { .. } => (),
662+
meta::Kind::Macro => (),
663+
meta::Kind::AttributeMacro => (),
664664
meta::Kind::Function { .. } => (),
665665
meta::Kind::Closure { .. } => (),
666666
meta::Kind::AsyncBlock { .. } => (),
667-
meta::Kind::ConstFn { .. } => (),
667+
meta::Kind::ConstFn => (),
668668
meta::Kind::Import { .. } => (),
669669
meta::Kind::Alias { .. } => (),
670-
meta::Kind::Module { .. } => (),
671-
meta::Kind::Trait { .. } => (),
670+
meta::Kind::Module => (),
671+
meta::Kind::Trait => (),
672672
}
673673

674674
Ok(())

crates/rune/src/doc/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ fn module<'m>(
10621062
})?;
10631063
}
10641064
Kind::Function(f) => {
1065-
if matches!(f.signature, Signature::Instance { .. }) {
1065+
if matches!(f.signature, Signature::Instance) {
10661066
continue;
10671067
}
10681068

@@ -1190,7 +1190,7 @@ fn build_function<'m>(cx: &mut Ctxt<'_, 'm>, meta: Meta<'m>) -> Result<Builder<'
11901190
let f = match meta.kind {
11911191
Kind::Function(
11921192
f @ Function {
1193-
signature: Signature::Function { .. },
1193+
signature: Signature::Function,
11941194
..
11951195
},
11961196
) => f,

crates/rune/src/doc/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ impl<'a> Context<'a> {
264264
arguments: f.arguments.as_deref(),
265265
return_type: &f.return_type,
266266
}),
267-
meta::Kind::Const { .. } => {
267+
meta::Kind::Const => {
268268
let const_value = self.context?.get_const_value(meta.hash)?;
269269
Kind::Const(const_value)
270270
}
271271
meta::Kind::Macro => Kind::Macro,
272-
meta::Kind::Module { .. } => Kind::Module,
273-
meta::Kind::Trait { .. } => Kind::Trait,
272+
meta::Kind::Module => Kind::Module,
273+
meta::Kind::Trait => Kind::Trait,
274274
_ => Kind::Unsupported,
275275
};
276276

crates/rune/src/doc/markdown.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ where
433433
TagEnd::Strikethrough => {
434434
self.write("</del>")?;
435435
}
436-
TagEnd::Link { .. } => {
436+
TagEnd::Link => {
437437
self.write("</a>")?;
438438
}
439-
TagEnd::Image { .. } => (),
439+
TagEnd::Image => (),
440440
TagEnd::FootnoteDefinition => {
441441
self.write("</div>")?;
442442
}

crates/rune/src/grammar/tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ impl<'a> Stream<'a> {
548548
if let Some(node) = self.next_node() {
549549
let inside = self.kind();
550550

551-
let span = match self.iter.last() {
551+
let span = match self.iter.next_back() {
552552
Some(last) => node.span().join(last.span()),
553553
None => *node.span(),
554554
};

crates/rune/src/hir/lowering.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ fn expr_block<'hir>(
10271027
captures,
10281028
})))
10291029
}
1030-
(ExprBlockKind::Const, meta::Kind::Const { .. }) => Ok(hir::ExprKind::Const(meta.hash)),
1030+
(ExprBlockKind::Const, meta::Kind::Const) => Ok(hir::ExprKind::Const(meta.hash)),
10311031
_ => Err(compile::Error::expected_meta(
10321032
ast,
10331033
meta.info(cx.q.pool)?,
@@ -1566,7 +1566,7 @@ fn expr_path_meta<'hir>(
15661566
..
15671567
} => Ok(hir::ExprKind::Fn(meta.hash)),
15681568
meta::Kind::Function { .. } => Ok(hir::ExprKind::Fn(meta.hash)),
1569-
meta::Kind::Const { .. } => Ok(hir::ExprKind::Const(meta.hash)),
1569+
meta::Kind::Const => Ok(hir::ExprKind::Const(meta.hash)),
15701570
meta::Kind::Struct { .. } | meta::Kind::Type { .. } | meta::Kind::Enum { .. } => {
15711571
Ok(hir::ExprKind::Type(Type::new(meta.hash)))
15721572
}

crates/rune/src/hir/lowering2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2092,7 +2092,7 @@ fn expr_path_meta<'hir>(
20922092
..
20932093
} => Ok(hir::ExprKind::Fn(meta.hash)),
20942094
meta::Kind::Function { .. } => Ok(hir::ExprKind::Fn(meta.hash)),
2095-
meta::Kind::Const { .. } => Ok(hir::ExprKind::Const(meta.hash)),
2095+
meta::Kind::Const => Ok(hir::ExprKind::Const(meta.hash)),
20962096
meta::Kind::Struct { .. } | meta::Kind::Type { .. } | meta::Kind::Enum { .. } => {
20972097
Ok(hir::ExprKind::Type(Type::new(meta.hash)))
20982098
}

crates/rune/src/hir/scopes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ impl<'hir, 'a> Scopes<'hir, 'a> {
198198
break 'ok (layer.scope, *id);
199199
}
200200

201-
if let LayerKind::Captures { .. } = layer.kind {
201+
if let LayerKind::Captures = layer.kind {
202202
blocks.try_push(layer.scope)?;
203203
}
204204

crates/rune/src/runtime/vm_error.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -888,11 +888,11 @@ impl fmt::Display for VmErrorKind {
888888
VmErrorKind::BadJump { error } => error.fmt(f),
889889
VmErrorKind::DynArgsUsed { error } => error.fmt(f),
890890
VmErrorKind::Panic { reason } => write!(f, "Panicked: {reason}"),
891-
VmErrorKind::NoRunningVm {} => write!(f, "No running virtual machines"),
891+
VmErrorKind::NoRunningVm => write!(f, "No running virtual machines"),
892892
VmErrorKind::Halted { halt } => write!(f, "Halted for unexpected reason `{halt}`"),
893-
VmErrorKind::Overflow {} => write!(f, "Numerical overflow"),
894-
VmErrorKind::Underflow {} => write!(f, "Numerical underflow"),
895-
VmErrorKind::DivideByZero {} => write!(f, "Division by zero"),
893+
VmErrorKind::Overflow => write!(f, "Numerical overflow"),
894+
VmErrorKind::Underflow => write!(f, "Numerical underflow"),
895+
VmErrorKind::DivideByZero => write!(f, "Division by zero"),
896896
VmErrorKind::MissingEntry { item, hash } => {
897897
write!(f, "Missing entry `{item}` with hash `{hash}`")
898898
}
@@ -1049,7 +1049,7 @@ impl fmt::Display for VmErrorKind {
10491049
VmErrorKind::ConstNotSupported { actual } => {
10501050
write!(f, "Type `{actual}` can't be converted to a constant value")
10511051
}
1052-
VmErrorKind::MissingInterfaceEnvironment {} => {
1052+
VmErrorKind::MissingInterfaceEnvironment => {
10531053
write!(f, "Missing interface environment")
10541054
}
10551055
VmErrorKind::ExpectedExecutionState { actual } => {
@@ -1058,15 +1058,15 @@ impl fmt::Display for VmErrorKind {
10581058
VmErrorKind::ExpectedExitedExecutionState { actual } => {
10591059
write!(f, "Expected exited execution state, but was {actual}")
10601060
}
1061-
VmErrorKind::GeneratorComplete {} => {
1061+
VmErrorKind::GeneratorComplete => {
10621062
write!(f, "Cannot resume a generator that has completed")
10631063
}
1064-
VmErrorKind::FutureCompleted {} => write!(f, "Future already completed"),
1064+
VmErrorKind::FutureCompleted => write!(f, "Future already completed"),
10651065
VmErrorKind::MissingVariant { name } => write!(f, "No variant matching `{name}`"),
10661066
VmErrorKind::MissingField { target, field } => {
10671067
write!(f, "Missing field `{field}` on `{target}`")
10681068
}
1069-
VmErrorKind::MissingVariantName {} => {
1069+
VmErrorKind::MissingVariantName => {
10701070
write!(f, "missing variant name in runtime information")
10711071
}
10721072
VmErrorKind::MissingStructField { target, name } => write!(

crates/rune/src/tests/compiler_literals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn number_literals_oob() {
1010

1111
assert_errors! {
1212
"-0aardvark",
13-
span!(1, 10), BadNumberLiteral { .. }
13+
span!(1, 10), BadNumberLiteral
1414
};
1515

1616
assert_errors! {

crates/rune/src/workspace/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ impl fmt::Display for WorkspaceErrorKind {
162162
WorkspaceErrorKind::MissingField { field } => {
163163
write!(f, "Missing required field `{field}`",)
164164
}
165-
WorkspaceErrorKind::ExpectedArray {} => write!(f, "Expected array"),
166-
WorkspaceErrorKind::MissingManifestPath {} => write!(
165+
WorkspaceErrorKind::ExpectedArray => write!(f, "Expected array"),
166+
WorkspaceErrorKind::MissingManifestPath => write!(
167167
f,
168168
"Element `[workspace]` can only be used in manifests with a valid path"
169169
),
170-
WorkspaceErrorKind::ExpectedTable {} => write!(f, "Expected table"),
170+
WorkspaceErrorKind::ExpectedTable => write!(f, "Expected table"),
171171
WorkspaceErrorKind::UnsupportedKey { key } => write!(f, "Key `{key}` not supported",),
172172
WorkspaceErrorKind::AllocError { error } => error.fmt(f),
173173
}

0 commit comments

Comments
 (0)