Preserve a better span for type id mismatch errors
diff --git a/Cargo.toml b/Cargo.toml
index 1455e55..dd7c18f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@
 cxx-build = { version = "=0.3.0", path = "gen/build" }
 cxx-test-suite = { version = "0", path = "tests/ffi" }
 rustversion = "1.0"
-trybuild = { version = "1.0.21", features = ["diff"] }
+trybuild = { version = "1.0.27", features = ["diff"] }
 
 [workspace]
 members = ["demo-rs", "gen/build", "gen/cmd", "macro", "tests/ffi"]
diff --git a/macro/src/expand.rs b/macro/src/expand.rs
index e3026ba..efd20e8 100644
--- a/macro/src/expand.rs
+++ b/macro/src/expand.rs
@@ -575,8 +575,13 @@
 fn expand_type_alias_verify(namespace: &Namespace, alias: &TypeAlias) -> TokenStream {
     let ident = &alias.ident;
     let type_id = type_id(namespace, ident);
+    let begin_span = alias.type_token.span;
+    let end_span = alias.semi_token.span;
+    let begin = quote_spanned!(begin_span=> ::cxx::private::verify_extern_type::<);
+    let end = quote_spanned!(end_span=> >);
+
     quote! {
-        const _: fn() = ::cxx::private::verify_extern_type::<#ident, #type_id>;
+        const _: fn() = #begin #ident, #type_id #end;
     }
 }
 
diff --git a/tests/ui/wrong_type_id.stderr b/tests/ui/wrong_type_id.stderr
index 165cdc0..969c826 100644
--- a/tests/ui/wrong_type_id.stderr
+++ b/tests/ui/wrong_type_id.stderr
@@ -1,14 +1,13 @@
 error[E0271]: type mismatch resolving `<here::StringPiece as cxx::extern_type::ExternType>::Id == (cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
- --> $DIR/wrong_type_id.rs:8:1
-  |
-8 | #[cxx::bridge(namespace = folly)]
-  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 15 elements, found one with 17 elements
-  | 
- ::: $WORKSPACE/src/extern_type.rs:6:41
-  |
-6 | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
-  |                                         ------- required by this bound in `cxx::extern_type::verify_extern_type`
-  |
-  = note: expected tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
-             found tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::S, cxx::t, cxx::r, cxx::i, cxx::n, cxx::g, cxx::P, cxx::i, cxx::e, cxx::c, cxx::e)`
-  = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
+  --> $DIR/wrong_type_id.rs:11:9
+   |
+11 |         type ByteRange = crate::here::StringPiece;
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 15 elements, found one with 17 elements
+   |
+  ::: $WORKSPACE/src/extern_type.rs:6:41
+   |
+6  | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
+   |                                         ------- required by this bound in `cxx::extern_type::verify_extern_type`
+   |
+   = note: expected tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::B, cxx::y, cxx::t, cxx::e, cxx::R, cxx::a, cxx::n, cxx::g, cxx::e)`
+              found tuple `(cxx::f, cxx::o, cxx::l, cxx::l, cxx::y, (), cxx::S, cxx::t, cxx::r, cxx::i, cxx::n, cxx::g, cxx::P, cxx::i, cxx::e, cxx::c, cxx::e)`