Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ as_conversions = "allow"
# Too many false positives when macros and/or loops are involved
cognitive_complexity = "allow"
expect_used = "allow"
inline_modules = "allow" # right now flags inline test modules, even if it shouldn't
let_underscore_must_use = "allow"
missing_assert_message = "allow"
multiple_inherent_impl = "allow"
Expand All @@ -368,6 +369,7 @@ unwrap_in_result = "allow"
# Consider enabling:
default_numeric_fallback = "allow"
impl_trait_in_params = "allow"
inline_trait_bounds = "allow"
iter_over_hash_type = "allow"
multiple_unsafe_ops_per_block = "allow"
pattern_type_mismatch = "allow"
Expand Down
1 change: 0 additions & 1 deletion libs/@local/codec/src/serde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//!
//! Many utilities here are designed to improve validation during deserialization
//! to ensure data integrity.

#![expect(
clippy::ref_option,
reason = "serde requires &Option<_> not Option<&_>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ where
.attach_with(|| {
format!(
"could not insert references for property type: {}",
&property_type.schema.id
property_type.schema.id
)
})
.attach_opaque_with(|| property_type.schema.clone())?;
Expand Down Expand Up @@ -953,7 +953,7 @@ where
.attach_with(|| {
format!(
"could not insert references for property type: {}",
&property_type.schema.id
property_type.schema.id
)
})
.attach_opaque_with(|| property_type.schema.clone())?;
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/graph/type-defs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ fn main() {
{
panic!("Failed to run codegen");
}
eprintln!("Generated files in: {}", &out_dir);
eprintln!("Generated files in: {out_dir}");
}
4 changes: 2 additions & 2 deletions libs/@local/harpc/net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
trait_alias,

// Library Features
error_generic_member_access,
error_generic_member_access
)]
#![cfg_attr(test, feature(async_fn_track_caller))]
#![cfg_attr(test, feature(async_fn_track_caller, core_io))]

extern crate alloc;

Expand Down
3 changes: 2 additions & 1 deletion libs/@local/harpc/net/src/session/server/test.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#![expect(clippy::significant_drop_tightening, reason = "test code")]
use alloc::sync::Arc;
use core::{
io::ErrorKind,
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
sync::atomic::{AtomicUsize, Ordering},
time::Duration,
};
use std::io::{self, ErrorKind};
use std::io;

use bytes::{Bytes, BytesMut};
use error_stack::{Report, ResultExt as _};
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/harpc/wire-protocol/src/codec/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::io::Cursor;
use core::io::Cursor;

use bytes::{Buf, BufMut, Bytes};
use error_stack::Report;
Expand Down
3 changes: 3 additions & 0 deletions libs/@local/harpc/wire-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#![feature(
// Language Features
exhaustive_patterns,

// Library Features,
core_io
)]

pub mod codec;
Expand Down
3 changes: 1 addition & 2 deletions libs/@local/hashql/compiletest/src/annotation/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ fn process_line_for_diagnostics(

#[cfg(test)]
mod tests {
use core::assert_matches;
use std::io::Cursor;
use core::{assert_matches, io::Cursor};

use crate::annotation::{
directive::Directive,
Expand Down
3 changes: 1 addition & 2 deletions libs/@local/hashql/compiletest/src/harness/trial/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use core::{any::Any, fmt::Display};
use core::{any::Any, fmt::Display, io::Cursor};
use std::{
fs::File,
io::Cursor,
panic,
path::{Path, PathBuf},
time::Instant,
Expand Down
3 changes: 2 additions & 1 deletion libs/@local/hashql/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@

// Library Features
allocator_api,
core_io,
duration_millis_float,
exitcode_exit_method,
file_buffered,
formatting_options,
macro_metavar_expr,
pattern,
string_from_utf8_lossy_owned,
try_trait_v2,
vec_from_fn,
macro_metavar_expr
)]

extern crate alloc;
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/hashql/core/src/graph/linked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl<N, E, A: Allocator> LinkedGraph<N, E, A> {
/// Returns a slice view of all nodes in the graph.
///
/// Nodes are indexed by their [`NodeId`] and returned in insertion order.
pub fn nodes(&self) -> &IdSlice<NodeId, Node<N>> {
pub const fn nodes(&self) -> &IdSlice<NodeId, Node<N>> {
self.nodes.as_slice()
}

Expand Down Expand Up @@ -434,7 +434,7 @@ impl<N, E, A: Allocator> LinkedGraph<N, E, A> {
/// Returns a slice view of all edges in the graph.
///
/// Edges are indexed by their [`EdgeId`] and returned in insertion order.
pub fn edges(&self) -> &IdSlice<EdgeId, Edge<E>> {
pub const fn edges(&self) -> &IdSlice<EdgeId, Edge<E>> {
self.edges.as_slice()
}

Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/core/src/id/bit_vec/matrix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl<R: Id, C: Id, A: Allocator> BitMatrix<R, C, A> {
/// Returns the underlying word buffer.
#[inline]
#[must_use]
pub fn words(&self) -> &[Word] {
pub const fn words(&self) -> &[Word] {
&self.words
}

Expand Down
4 changes: 2 additions & 2 deletions libs/@local/hashql/core/src/id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub const trait HasId {
fn id(&self) -> Self::Id;
}

impl<T> const HasId for &T
const impl<T> HasId for &T
where
T: [const] HasId,
{
Expand All @@ -210,7 +210,7 @@ where
}
}

impl<I, T> const HasId for (I, T)
const impl<I, T> HasId for (I, T)
where
I: Id,
{
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/hashql/core/src/id/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ where
///
/// See [`Vec::as_slice`] for details.
#[inline]
pub fn as_slice(&self) -> &IdSlice<I, T> {
pub const fn as_slice(&self) -> &IdSlice<I, T> {
IdSlice::from_raw(&self.raw)
}

/// Extracts a mutable slice containing the entire vector as an `IdSlice`.
///
/// See [`Vec::as_mut_slice`] for details.
#[inline]
pub fn as_mut_slice(&mut self) -> &mut IdSlice<I, T> {
pub const fn as_mut_slice(&mut self) -> &mut IdSlice<I, T> {
IdSlice::from_raw_mut(&mut self.raw)
}

Expand Down
4 changes: 2 additions & 2 deletions libs/@local/hashql/core/src/symbol/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Repr {
#[inline]
#[expect(clippy::cast_ptr_alignment)]
unsafe fn as_runtime(self) -> *mut RuntimeRepr {
debug_assert!(self.tag() == Self::TAG_RUNTIME);
debug_assert_eq!(self.tag(), Self::TAG_RUNTIME);

self.ptr
.map_addr(|addr| {
Expand All @@ -264,7 +264,7 @@ impl Repr {
/// - `self` must have been created via [`Repr::constant`].
#[inline]
unsafe fn as_constant(self) -> ConstantRepr {
debug_assert!(self.tag() == Self::TAG_CONSTANT);
debug_assert_eq!(self.tag(), Self::TAG_CONSTANT);

let addr = self.ptr.addr().get();
ConstantRepr((addr & !Self::TAG_MASK) >> Self::TAG_SHIFT)
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/diagnostics/src/diagnostic/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl<S> Labels<S> {
}

#[cfg(feature = "render")]
pub(crate) fn as_slice(&self) -> &[Label<S>] {
pub(crate) const fn as_slice(&self) -> &[Label<S>] {
&self.labels
}

Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/diagnostics/src/diagnostic/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<S> Messages<S> {
}
}

impl<S> const Default for Messages<S> {
const impl<S> Default for Messages<S> {
fn default() -> Self {
Self::new()
}
Expand Down
8 changes: 4 additions & 4 deletions libs/@local/hashql/diagnostics/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub(crate) mod style {
}
}

impl const From<Style> for StyleProxy {
const impl From<Style> for StyleProxy {
fn from(value: Style) -> Self {
Self {
effects: value.get_effects(),
Expand All @@ -55,7 +55,7 @@ pub(crate) mod style {
}
}

impl const From<StyleProxy> for Style {
const impl From<StyleProxy> for Style {
fn from(value: StyleProxy) -> Self {
Self::new()
.effects(value.effects)
Expand Down Expand Up @@ -198,13 +198,13 @@ pub(crate) mod color {
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct ColorProxy(Color);

impl const From<Color> for ColorProxy {
const impl From<Color> for ColorProxy {
fn from(color: Color) -> Self {
Self(color)
}
}

impl const From<ColorProxy> for Color {
const impl From<ColorProxy> for Color {
fn from(color_proxy: ColorProxy) -> Self {
color_proxy.0
}
Expand Down
10 changes: 5 additions & 5 deletions libs/@local/hashql/diagnostics/src/severity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl Severity {
}
}

impl const SeverityKind for Severity {
const impl SeverityKind for Severity {
fn is_critical(self) -> bool {
self.code() >= 400
}
Expand Down Expand Up @@ -578,7 +578,7 @@ impl Critical {
}
}

impl const SeverityKind for Critical {
const impl SeverityKind for Critical {
fn is_critical(self) -> bool {
true
}
Expand Down Expand Up @@ -606,7 +606,7 @@ impl PartialOrd for Critical {
}
}

impl const From<Critical> for Severity {
const impl From<Critical> for Severity {
fn from(severity: Critical) -> Self {
severity.0
}
Expand Down Expand Up @@ -716,7 +716,7 @@ impl Advisory {
}
}

impl const SeverityKind for Advisory {
const impl SeverityKind for Advisory {
fn is_critical(self) -> bool {
false
}
Expand Down Expand Up @@ -744,7 +744,7 @@ impl PartialOrd for Advisory {
}
}

impl const From<Advisory> for Severity {
const impl From<Advisory> for Severity {
fn from(severity: Advisory) -> Self {
severity.0
}
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/diagnostics/src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl<'source> Sources<'source> {
}
}

impl const Default for Sources<'_> {
const impl Default for Sources<'_> {
fn default() -> Self {
Self::new()
}
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/eval/tests/orchestrator/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(allocator_api)]
#![feature(allocator_api, core_io)]
extern crate alloc;

use alloc::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion libs/@local/hashql/eval/tests/orchestrator/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub(crate) fn compare_or_bless(

let expected = match fs::read_to_string(expected_path) {
Ok(contents) => contents,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
Err(error) if error.kind() == core::io::ErrorKind::NotFound => {
return Err(Report::new(TestError::OutputMismatch)
.attach(format!(
"expected output file {} does not exist; run with --bless to create it",
Expand Down
4 changes: 2 additions & 2 deletions libs/@local/hashql/mir/src/body/terminator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<'heap> TerminatorKind<'heap> {
/// Note that [`GraphRead`] returns an empty slice because it injects its own target
/// rather than using the standard target mechanism.
#[must_use]
pub fn successor_targets(&self) -> &[Target<'heap>] {
pub const fn successor_targets(&self) -> &[Target<'heap>] {
match self {
Self::Goto(goto) => core::slice::from_ref(&goto.target),
Self::SwitchInt(switch) => switch.targets.targets(),
Expand All @@ -238,7 +238,7 @@ impl<'heap> TerminatorKind<'heap> {
/// Returns [`Some`] with a mutable slice for terminators that have modifiable targets
/// ([`Goto`], [`SwitchInt`]), or [`None`] for terminators without modifiable targets
/// ([`Return`], [`GraphRead`], [`Unreachable`](Self::Unreachable)).
pub fn successor_targets_mut(&mut self) -> Option<&mut [Target<'heap>]> {
pub const fn successor_targets_mut(&mut self) -> Option<&mut [Target<'heap>]> {
match self {
Self::Goto(goto) => Some(core::slice::from_mut(&mut goto.target)),
Self::SwitchInt(switch) => Some(switch.targets.targets_mut()),
Expand Down
6 changes: 3 additions & 3 deletions libs/@local/hashql/mir/src/body/terminator/switch_int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,23 +380,23 @@ impl<'heap> SwitchTargets<'heap> {
/// The slice contains all targets in the same order as the values, with the
/// otherwise target (if any) as the last element.
#[must_use]
pub fn targets(&self) -> &[Target<'heap>] {
pub const fn targets(&self) -> &[Target<'heap>] {
&self.targets
}

/// Returns a mutable slice of all targets, including the otherwise target if present.
///
/// The slice contains all targets in the same order as the values, with the
/// otherwise target (if any) as the last element.
pub fn targets_mut(&mut self) -> &mut [Target<'heap>] {
pub const fn targets_mut(&mut self) -> &mut [Target<'heap>] {
&mut self.targets
}

/// Returns a slice of all discriminant values in sorted order.
///
/// The values are guaranteed to be sorted in ascending order and to be unique.
#[must_use]
pub fn values(&self) -> &[u128] {
pub const fn values(&self) -> &[u128] {
&self.values
}

Expand Down
Loading
Loading