Skip to content

Commit 5eac936

Browse files
committed
Fix issues allowing use of assert
Signed-off-by: Simon Davies <[email protected]>
1 parent d3a7498 commit 5eac936

File tree

13 files changed

+10
-18
lines changed

13 files changed

+10
-18
lines changed
File renamed without changes.

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use std::thread;
1818

1919
use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnType};

src/hyperlight_host/examples/hello-world/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use std::thread;
1818

1919
use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnType};

src/hyperlight_host/examples/logging/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
extern crate hyperlight_host;
1818
use std::sync::{Arc, Mutex};
1919

src/hyperlight_host/examples/metrics/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
extern crate hyperlight_host;
1818
use std::sync::{Arc, Mutex};
1919
use std::thread::{spawn, JoinHandle};

src/hyperlight_host/examples/tracing-chrome/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use hyperlight_host::func::{ParameterValue, ReturnType, ReturnValue};
1818
use hyperlight_host::sandbox::uninitialized::UninitializedSandbox;
1919
use hyperlight_host::sandbox_state::sandbox::EvolvableSandbox;

src/hyperlight_host/examples/tracing-otlp/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnType};
1818
//use opentelemetry_sdk::resource::ResourceBuilder;
1919
use opentelemetry_sdk::trace::SdkTracerProvider;

src/hyperlight_host/examples/tracing-tracy/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use hyperlight_host::func::{ParameterValue, ReturnType, ReturnValue};
1818
use hyperlight_host::sandbox::uninitialized::UninitializedSandbox;
1919
use hyperlight_host::sandbox_state::sandbox::EvolvableSandbox;

src/hyperlight_host/examples/tracing/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
#![allow(clippy::disallowed_macros)]
1717
use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnType};
1818
use tracing::{span, Level};
1919
extern crate hyperlight_host;

src/hyperlight_host/src/hypervisor/windows_hypervisor_platform.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ use crate::hypervisor::wrappers::{WHvFPURegisters, WHvGeneralRegisters, WHvSpeci
2828
use crate::mem::memory_region::{MemoryRegion, MemoryRegionFlags};
2929
use crate::{new_error, Result};
3030

31-
// We need to pass in a primitive array of register names/values
32-
// to WHvSetVirtualProcessorRegisters and rust needs to know array size
33-
// at compile time. There is an assert in set_virtual_process_registers
34-
// to ensure we never try and set more registers than this constant
35-
const REGISTER_COUNT: usize = 16;
36-
3731
/// Interop calls for Windows Hypervisor Platform APIs
3832
///
3933
/// Documentation can be found at:
@@ -218,7 +212,6 @@ impl VMProcessor {
218212
) -> Result<()> {
219213
let partition_handle = self.get_partition_hdl();
220214
let register_count = registers.len();
221-
assert!(register_count <= REGISTER_COUNT);
222215
let mut register_names: Vec<WHV_REGISTER_NAME> = vec![];
223216
let mut register_values: Vec<WHV_REGISTER_VALUE> = vec![];
224217

0 commit comments

Comments
 (0)