File tree Expand file tree Collapse file tree 12 files changed +25
-14
lines changed Expand file tree Collapse file tree 12 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ impl CublasContext {
340
340
impl Drop for CublasContext {
341
341
fn drop ( & mut self ) {
342
342
unsafe {
343
- cublas_sys:: cublasDestroy ( self . raw ) ;
343
+ let _ = cublas_sys:: cublasDestroy ( self . raw ) ;
344
344
}
345
345
}
346
346
}
Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ impl Drop for Context {
372
372
373
373
unsafe {
374
374
let inner = mem:: replace ( & mut self . inner , ptr:: null_mut ( ) ) ;
375
- driver_sys:: cuCtxDestroy ( inner) ;
375
+ let _ = driver_sys:: cuCtxDestroy ( inner) ;
376
376
}
377
377
}
378
378
}
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ impl Context {
197
197
driver_sys:: cuDevicePrimaryCtxRetain ( inner. as_mut_ptr ( ) , device. as_raw ( ) )
198
198
. to_result ( ) ?;
199
199
let inner = inner. assume_init ( ) ;
200
- driver_sys:: cuCtxSetCurrent ( inner) ;
200
+ driver_sys:: cuCtxSetCurrent ( inner) . to_result ( ) ? ;
201
201
Ok ( Self {
202
202
inner,
203
203
device : device. as_raw ( ) ,
@@ -316,7 +316,7 @@ impl Drop for Context {
316
316
317
317
unsafe {
318
318
self . inner = ptr:: null_mut ( ) ;
319
- driver_sys:: cuDevicePrimaryCtxRelease ( self . device ) ;
319
+ let _ = driver_sys:: cuDevicePrimaryCtxRelease ( self . device ) ;
320
320
}
321
321
}
322
322
}
Original file line number Diff line number Diff line change @@ -347,7 +347,9 @@ impl Event {
347
347
348
348
impl Drop for Event {
349
349
fn drop ( & mut self ) {
350
- unsafe { cuEventDestroy ( self . 0 ) } ;
350
+ unsafe {
351
+ let _ = cuEventDestroy ( self . 0 ) ;
352
+ } ;
351
353
}
352
354
}
353
355
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ impl Linker {
137
137
138
138
impl Drop for Linker {
139
139
fn drop ( & mut self ) {
140
- unsafe { driver_sys:: cuLinkDestroy ( self . raw ) } ;
140
+ unsafe {
141
+ let _ = driver_sys:: cuLinkDestroy ( self . raw ) ;
142
+ } ;
141
143
}
142
144
}
Original file line number Diff line number Diff line change @@ -867,7 +867,9 @@ impl std::fmt::Debug for ArrayObject {
867
867
868
868
impl Drop for ArrayObject {
869
869
fn drop ( & mut self ) {
870
- unsafe { driver_sys:: cuArrayDestroy ( self . handle ) } ;
870
+ unsafe {
871
+ let _ = driver_sys:: cuArrayDestroy ( self . handle ) ;
872
+ } ;
871
873
}
872
874
}
873
875
Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ impl Drop for Module {
491
491
unsafe {
492
492
// No choice but to panic if this fails...
493
493
let module = mem:: replace ( & mut self . inner , ptr:: null_mut ( ) ) ;
494
- driver_sys:: cuModuleUnload ( module) ;
494
+ let _ = driver_sys:: cuModuleUnload ( module) ;
495
495
}
496
496
}
497
497
}
Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ impl Drop for Stream {
344
344
unsafe {
345
345
let inner = mem:: replace ( & mut self . inner , ptr:: null_mut ( ) ) ;
346
346
347
- driver_sys:: cuStreamDestroy ( inner) ;
347
+ let _ = driver_sys:: cuStreamDestroy ( inner) ;
348
348
}
349
349
}
350
350
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl Drop for Surface {
30
30
}
31
31
}
32
32
33
- cuSurfObjectDestroy ( self . handle ) ;
33
+ let _ = cuSurfObjectDestroy ( self . handle ) ;
34
34
}
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ impl Drop for Texture {
415
415
}
416
416
}
417
417
418
- cuTexObjectDestroy ( self . handle ) ;
418
+ let _ = cuTexObjectDestroy ( self . handle ) ;
419
419
}
420
420
}
421
421
}
You can’t perform that action at this time.
0 commit comments