Refactor item_name method to use ItemInfo struct
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs
index 0d8fa33..ef16777 100644
--- a/bindgen-integration/build.rs
+++ b/bindgen-integration/build.rs
@@ -1,7 +1,8 @@
 extern crate bindgen;
 
 use bindgen::callbacks::{
-    DeriveInfo, IntKind, MacroParsingBehavior, ParseCallbacks, Token, TokenKind,
+    DeriveInfo, IntKind, ItemInfo, MacroParsingBehavior, ParseCallbacks, Token,
+    TokenKind,
 };
 use bindgen::{Builder, EnumVariation, Formatter};
 use std::collections::HashSet;
@@ -103,16 +104,18 @@
         }
     }
 
-    fn item_name(&self, original_item_name: &str) -> Option<String> {
-        if original_item_name.starts_with("my_prefixed_") {
+    fn item_name(&self, item_info: ItemInfo) -> Option<String> {
+        if item_info.name.starts_with("my_prefixed_") {
             Some(
-                original_item_name
+                item_info
+                    .name
                     .trim_start_matches("my_prefixed_")
                     .to_string(),
             )
-        } else if original_item_name.starts_with("MY_PREFIXED_") {
+        } else if item_info.name.starts_with("MY_PREFIXED_") {
             Some(
-                original_item_name
+                item_info
+                    .name
                     .trim_start_matches("MY_PREFIXED_")
                     .to_string(),
             )
diff --git a/bindgen/callbacks.rs b/bindgen/callbacks.rs
index f7f2f6c..93005ce 100644
--- a/bindgen/callbacks.rs
+++ b/bindgen/callbacks.rs
@@ -94,8 +94,8 @@
         None
     }
 
-    /// Allows to rename an item, replacing `_original_item_name`.
-    fn item_name(&self, _original_item_name: &str) -> Option<String> {
+    /// Allows to rename an item, replacing `_item_info.name`.
+    fn item_name(&self, _item_info: ItemInfo) -> Option<String> {
         None
     }
 
@@ -280,6 +280,7 @@
 }
 
 /// A struct providing information about the item being passed to [`ParseCallbacks::generated_name_override`].
+#[derive(Clone, Copy)]
 #[non_exhaustive]
 pub struct ItemInfo<'a> {
     /// The name of the item
@@ -289,8 +290,13 @@
 }
 
 /// An enum indicating the kind of item for an `ItemInfo`.
+#[derive(Clone, Copy)]
 #[non_exhaustive]
 pub enum ItemKind {
+    /// A module
+    Module,
+    /// A type
+    Type,
     /// A Function
     Function,
     /// A Variable
diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs
index 25c3c25..d38879f 100644
--- a/bindgen/ir/item.rs
+++ b/bindgen/ir/item.rs
@@ -17,6 +17,7 @@
 use super::template::{AsTemplateParam, TemplateParameters};
 use super::traversal::{EdgeKind, Trace, Tracer};
 use super::ty::{Type, TypeKind};
+use crate::callbacks::ItemInfo;
 use crate::clang;
 use crate::parse::{ClangSubItemParser, ParseError, ParseResult};
 
@@ -922,8 +923,19 @@
         let name = names.join("_");
 
         let name = if opt.user_mangled == UserMangled::Yes {
+            let item_info = ItemInfo {
+                name: &name,
+                kind: match self.kind() {
+                    ItemKind::Module(..) => crate::callbacks::ItemKind::Module,
+                    ItemKind::Type(..) => crate::callbacks::ItemKind::Type,
+                    ItemKind::Function(..) => {
+                        crate::callbacks::ItemKind::Function
+                    }
+                    ItemKind::Var(..) => crate::callbacks::ItemKind::Var,
+                },
+            };
             ctx.options()
-                .last_callback(|callbacks| callbacks.item_name(&name))
+                .last_callback(|callbacks| callbacks.item_name(item_info))
                 .unwrap_or(name)
         } else {
             name