@@ -410,39 +410,37 @@ pub struct InterruptDescriptorTable {
410410}
411411
412412impl InterruptDescriptorTable {
413- // TODO: Remove const_fn! when our minimum supported stable Rust version is 1.61
414- const_fn ! {
415- /// Creates a new IDT filled with non-present entries.
416- #[ inline]
417- pub fn new( ) -> InterruptDescriptorTable {
418- InterruptDescriptorTable {
419- divide_error: Entry :: missing( ) ,
420- debug: Entry :: missing( ) ,
421- non_maskable_interrupt: Entry :: missing( ) ,
422- breakpoint: Entry :: missing( ) ,
423- overflow: Entry :: missing( ) ,
424- bound_range_exceeded: Entry :: missing( ) ,
425- invalid_opcode: Entry :: missing( ) ,
426- device_not_available: Entry :: missing( ) ,
427- double_fault: Entry :: missing( ) ,
428- coprocessor_segment_overrun: Entry :: missing( ) ,
429- invalid_tss: Entry :: missing( ) ,
430- segment_not_present: Entry :: missing( ) ,
431- stack_segment_fault: Entry :: missing( ) ,
432- general_protection_fault: Entry :: missing( ) ,
433- page_fault: Entry :: missing( ) ,
434- reserved_1: Entry :: missing( ) ,
435- x87_floating_point: Entry :: missing( ) ,
436- alignment_check: Entry :: missing( ) ,
437- machine_check: Entry :: missing( ) ,
438- simd_floating_point: Entry :: missing( ) ,
439- virtualization: Entry :: missing( ) ,
440- reserved_2: [ Entry :: missing( ) ; 8 ] ,
441- vmm_communication_exception: Entry :: missing( ) ,
442- security_exception: Entry :: missing( ) ,
443- reserved_3: Entry :: missing( ) ,
444- interrupts: [ Entry :: missing( ) ; 256 - 32 ] ,
445- }
413+ /// Creates a new IDT filled with non-present entries.
414+ #[ inline]
415+ #[ rustversion:: attr( since( 1.61 ) , const ) ]
416+ pub fn new ( ) -> InterruptDescriptorTable {
417+ InterruptDescriptorTable {
418+ divide_error : Entry :: missing ( ) ,
419+ debug : Entry :: missing ( ) ,
420+ non_maskable_interrupt : Entry :: missing ( ) ,
421+ breakpoint : Entry :: missing ( ) ,
422+ overflow : Entry :: missing ( ) ,
423+ bound_range_exceeded : Entry :: missing ( ) ,
424+ invalid_opcode : Entry :: missing ( ) ,
425+ device_not_available : Entry :: missing ( ) ,
426+ double_fault : Entry :: missing ( ) ,
427+ coprocessor_segment_overrun : Entry :: missing ( ) ,
428+ invalid_tss : Entry :: missing ( ) ,
429+ segment_not_present : Entry :: missing ( ) ,
430+ stack_segment_fault : Entry :: missing ( ) ,
431+ general_protection_fault : Entry :: missing ( ) ,
432+ page_fault : Entry :: missing ( ) ,
433+ reserved_1 : Entry :: missing ( ) ,
434+ x87_floating_point : Entry :: missing ( ) ,
435+ alignment_check : Entry :: missing ( ) ,
436+ machine_check : Entry :: missing ( ) ,
437+ simd_floating_point : Entry :: missing ( ) ,
438+ virtualization : Entry :: missing ( ) ,
439+ reserved_2 : [ Entry :: missing ( ) ; 8 ] ,
440+ vmm_communication_exception : Entry :: missing ( ) ,
441+ security_exception : Entry :: missing ( ) ,
442+ reserved_3 : Entry :: missing ( ) ,
443+ interrupts : [ Entry :: missing ( ) ; 256 - 32 ] ,
446444 }
447445 }
448446
0 commit comments