Skip to content

Commit 82270bf

Browse files
authored
rust 1.89 fixes (#870)
1 parent d78e7df commit 82270bf

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

example-build/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// Copyright 2022 Oxide Computer Company
1+
// Copyright 2025 Oxide Computer Company
2+
3+
#![allow(clippy::derivable_impls)]
24

35
// Include the generated code.
46
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.85.0"
2+
channel = "1.89.0"
33
profile = "default"

typify-impl/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl TypeSpace {
794794
}
795795

796796
/// Get a type given its ID.
797-
pub fn get_type(&self, type_id: &TypeId) -> Result<Type> {
797+
pub fn get_type(&self, type_id: &TypeId) -> Result<Type<'_>> {
798798
let type_entry = self.id_to_entry.get(type_id).ok_or(Error::InvalidTypeId)?;
799799
Ok(Type {
800800
type_space: self,
@@ -824,7 +824,7 @@ impl TypeSpace {
824824

825825
/// Iterate over all types including those defined in this [TypeSpace] and
826826
/// those referred to by those types.
827-
pub fn iter_types(&self) -> impl Iterator<Item = Type> {
827+
pub fn iter_types(&self) -> impl Iterator<Item = Type<'_>> {
828828
self.id_to_entry.values().map(move |type_entry| Type {
829829
type_space: self,
830830
type_entry,
@@ -1033,7 +1033,7 @@ impl Type<'_> {
10331033
}
10341034

10351035
/// Get details about the type.
1036-
pub fn details(&self) -> TypeDetails {
1036+
pub fn details(&self) -> TypeDetails<'_> {
10371037
match &self.type_entry.details {
10381038
// Named user-defined types
10391039
TypeEntryDetails::Enum(details) => TypeDetails::Enum(TypeEnum { details }),

typify-test/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Oxide Computer Company
1+
// Copyright 2025 Oxide Computer Company
22

33
// Include the generated code to make sure it compiles.
44
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
@@ -57,6 +57,8 @@ fn test_unknown_format() {
5757
}
5858

5959
mod hashmap {
60+
#![allow(dead_code)]
61+
6062
include!(concat!(env!("OUT_DIR"), "/codegen_hashmap.rs"));
6163

6264
#[test]
@@ -69,6 +71,8 @@ mod hashmap {
6971
}
7072

7173
mod custom_map {
74+
#![allow(dead_code)]
75+
7276
#[allow(private_interfaces)]
7377
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
7478
pub struct CustomMap<K, V> {

0 commit comments

Comments
 (0)