Skip to content

Commit 6b88ffa

Browse files
committed
Fix clippy warnings that are enabled in newer toolchains
1 parent 06c0df3 commit 6b88ffa

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

src/hyperlight_component_util/src/subtype.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub enum Error<'r> {
3636
/// A value type was present, but incompatible with its expected type
3737
MismatchedValue(Value<'r>, Value<'r>),
3838
/// A defined type was present, but incompatible with its expected type
39-
MismatchedDefined(Defined<'r>, Defined<'r>),
39+
MismatchedDefined(Box<Defined<'r>>, Box<Defined<'r>>),
4040
/// A resource was present, but was not the same resource as was expected
4141
MismatchedResources(ResourceId, ResourceId),
4242
/// A type variable could not be resolved to be the same as the
@@ -239,7 +239,10 @@ impl<'p, 'a> Ctx<'p, 'a> {
239239
self.subtype_qualified_instance(it1, it2)
240240
}
241241
(Defined::Component(ct1), Defined::Component(ct2)) => self.subtype_component(ct1, ct2),
242-
_ => Err(Error::MismatchedDefined(dt1.clone(), dt2.clone())),
242+
_ => Err(Error::MismatchedDefined(
243+
Box::new(dt1.clone()),
244+
Box::new(dt2.clone()),
245+
)),
243246
}
244247
}
245248
pub fn subtype_handleable_is_resource<'r>(&self, ht: &'r Handleable) -> Result<(), Error<'a>> {

src/hyperlight_host/src/hypervisor/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ pub trait InterruptHandle: Debug + Send + Sync {
378378
///
379379
/// - If this is called while the vcpu is running, then it will interrupt the vcpu and return `true`.
380380
/// - If this is called while the vcpu is not running, (for example during a host call), the
381-
/// vcpu will not immediately be interrupted, but will prevent the vcpu from running **the next time**
382-
/// it's scheduled, and returns `false`.
381+
/// vcpu will not immediately be interrupted, but will prevent the vcpu from running **the next time**
382+
/// it's scheduled, and returns `false`.
383383
///
384384
/// # Note
385385
/// This function will block for the duration of the time it takes for the vcpu thread to be interrupted.
@@ -389,8 +389,8 @@ pub trait InterruptHandle: Debug + Send + Sync {
389389
///
390390
/// - If this is called while the vcpu is running, then it will interrupt the vcpu and return `true`.
391391
/// - If this is called while the vcpu is not running, (for example during a host call), the
392-
/// vcpu will not immediately be interrupted, but will prevent the vcpu from running **the next time**
393-
/// it's scheduled, and returns `false`.
392+
/// vcpu will not immediately be interrupted, but will prevent the vcpu from running **the next time**
393+
/// it's scheduled, and returns `false`.
394394
///
395395
/// # Note
396396
/// This function will block for the duration of the time it takes for the vcpu thread to be interrupted.
@@ -412,7 +412,7 @@ pub(super) struct LinuxInterruptHandle {
412412
/// 1. The VCPU is running (generation N),
413413
/// 2. It gets cancelled,
414414
/// 3. Then quickly restarted (generation N+1),
415-
/// before the original thread has observed that it was cancelled.
415+
/// before the original thread has observed that it was cancelled.
416416
///
417417
/// Without this generation counter, the interrupt logic might assume the VCPU is still
418418
/// in the *original* run (generation N), see that it's `running`, and re-send the signal.
@@ -428,9 +428,9 @@ pub(super) struct LinuxInterruptHandle {
428428
/// `kill()` is called, and cleared when the vcpu is no longer running.
429429
/// This is used to
430430
/// 1. make sure stale signals do not interrupt the
431-
/// the wrong vcpu (a vcpu may only be interrupted iff `cancel_requested` is true),
431+
/// the wrong vcpu (a vcpu may only be interrupted iff `cancel_requested` is true),
432432
/// 2. ensure that if a vm is killed while a host call is running,
433-
/// the vm will not re-enter the guest after the host call returns.
433+
/// the vm will not re-enter the guest after the host call returns.
434434
cancel_requested: AtomicBool,
435435
/// True when the debugger has requested the VM to be interrupted. Set immediately when
436436
/// `kill_from_debugger()` is called, and cleared when the vcpu is no longer running.

src/hyperlight_host/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub mod hypervisor;
5050
/// present and code length will be zero;
5151
///
5252
/// - The pointer passed to the Entrypoint in the Guest application is the size of page table + size of code,
53-
/// at this address structs below are laid out in this order
53+
/// at this address structs below are laid out in this order
5454
pub mod mem;
5555
/// Metric definitions and helpers
5656
pub mod metrics;

src/hyperlight_host/src/mem/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use crate::{Result, new_error};
6464
// +-------------------------------------------+ 0x0_000
6565

6666
/// - `InitData` - some extra data that can be loaded onto the sandbox during
67-
/// initialization.
67+
/// initialization.
6868
///
6969
/// - `HostDefinitions` - the length of this is the `HostFunctionDefinitionSize`
7070
/// field from `SandboxConfiguration`

src/hyperlight_host/src/mem/shared_mem.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ impl HostSharedMemory {
785785
/// patterns
786786
pub fn read<T: AllValid>(&self, offset: usize) -> Result<T> {
787787
bounds_check!(offset, std::mem::size_of::<T>(), self.mem_size());
788-
let ret = unsafe {
788+
unsafe {
789789
let mut ret: core::mem::MaybeUninit<T> = core::mem::MaybeUninit::uninit();
790790
{
791791
let slice: &mut [u8] = core::slice::from_raw_parts_mut(
@@ -795,8 +795,7 @@ impl HostSharedMemory {
795795
self.copy_to_slice(slice, offset)?;
796796
}
797797
Ok(ret.assume_init())
798-
};
799-
ret
798+
}
800799
}
801800

802801
/// Write a value of type T, whose representation is the same

0 commit comments

Comments
 (0)