Some external interrupts not working on STM32F103C8T6

I have the following code that is supposed to enable interrupts on PB8 of the STM32F103C8T6. Hitting the button connected to PB8 prints out changes in the pin level from main but the interrupt handler is not being executed. What may be the issue?

// std and main are not available for bare metal software

extern crate panic_halt;

use core::cell::RefCell;
// use core::sync::atomic::{AtomicUsize, Ordering};
use cortex_m::interrupt as cortex_m_interrupt;

use cortex_m_rt;
use stm32f1;

use cortex_m_semihosting::hprintln;

use cortex_m_rt::entry;
use stm32f1::stm32f103;
use stm32f1::stm32f103::interrupt;

// static Y: AtomicUsize = AtomicUsize::new(0);
// static X: AtomicUsize = AtomicUsize::new(0);

static EXTI: cortex_m_interrupt::Mutex<RefCell<Option<stm32f103::EXTI>>> =

fn ADC1_2() -> ! {
    hprintln!("ADC interrupt!").unwrap();

fn EXTI3() -> ! {
    hprintln!("Click nterrupt!").unwrap();
    cortex_m_interrupt::free(|cs| {
            .write(|w| w.pr8().set_bit());

fn configure_joystick(peripherals: &stm32f103::Peripherals) {
    // configure  PB8 and an input
    peripherals.RCC.apb2enr.write(|w| w.iopben().set_bit());
    peripherals.GPIOB.crh.write(|w| unsafe {
    // enable pull-up resistors on PB8
    peripherals.GPIOB.bsrr.write(|w| w.br8().set_bit());
    // set MR12 in IMR
    peripherals.EXTI.imr.write(|w| w.mr8().set_bit());
    // set MR12 in RTMR
    peripherals.EXTI.rtsr.write(|w| w.tr8().set_bit());
    // set the interrupt source as PB8 pin
        .write(|w| unsafe { w.exti8().bits(0b0001) });

// use `main` as the entry point of this application
fn main() -> ! {
    // get handles to the hardware
    let peripherals = stm32f103::Peripherals::take().unwrap();
    let exti = peripherals.EXTI;
    // initialize PR reference before enabling interrupts
    cortex_m_interrupt::free(|cs| EXTI.borrow(cs).replace(Some(exti)));
    // enable EXTI3 interrupts
    let mut core_peripherals = stm32f103::CorePeripherals::take().unwrap();
    loop {
        match {
            stm32f103::gpioa::idr::IDR0R::HIGH => {
                let _res = hprintln!("A1 = HIGH");
            stm32f103::gpioa::idr::IDR0R::LOW => {
                let _res = hprintln!("A1 = LOW");