@@ -12,10 +12,7 @@ use std::path::{Path, PathBuf};
12
12
13
13
/// Represents a functional backend installation, whether it was cached or just installed.
14
14
#[ derive( Clone , Debug ) ]
15
- #[ expect(
16
- clippy:: exhaustive_structs,
17
- reason = "never adding private members to this struct"
18
- ) ]
15
+ #[ non_exhaustive]
19
16
pub struct InstalledBackend {
20
17
/// path to the `rustc_codegen_spirv` dylib
21
18
pub rustc_codegen_spirv_location : PathBuf ,
@@ -28,9 +25,8 @@ pub struct InstalledBackend {
28
25
impl InstalledBackend {
29
26
/// Creates a new `SpirvBuilder` configured to use this installed backend.
30
27
#[ expect(
31
- clippy:: missing_panics_doc,
32
- clippy:: expect_used,
33
- reason = "unreachable"
28
+ clippy:: unreachable,
29
+ reason = "it's unreachable, no need to return a Result"
34
30
) ]
35
31
#[ expect( clippy:: impl_trait_in_params, reason = "forwarding spirv-builder API" ) ]
36
32
#[ inline]
@@ -40,8 +36,11 @@ impl InstalledBackend {
40
36
target : impl Into < String > ,
41
37
) -> SpirvBuilder {
42
38
let mut builder = SpirvBuilder :: new ( path_to_crate, target) ;
43
- self . configure_spirv_builder ( & mut builder)
44
- . expect ( "unreachable" ) ;
39
+ let result = self . configure_spirv_builder ( & mut builder) ;
40
+ match result {
41
+ Ok ( ( ) ) => ( ) ,
42
+ Err ( _) => unreachable ! ( "we set target before calling this function" ) ,
43
+ }
45
44
builder
46
45
}
47
46
0 commit comments