diff --git a/syntax/check.rs b/syntax/check.rs index b315ae72..9a8881f2 100644 --- a/syntax/check.rs +++ b/syntax/check.rs @@ -71,11 +71,6 @@ fn check_type_ident(cx: &mut Check, name: &NamedType) { { let msg = format!("unsupported type: {}", ident); cx.error(ident, &msg); - return; - } - - if !name.generics.lifetimes.is_empty() { - cx.error(name, "type with lifetime parameter is not supported yet"); } } @@ -341,7 +336,10 @@ fn check_api_type(cx: &mut Check, ety: &ExternType) { } if let Some(lifetime) = ety.generics.lifetimes.first() { - cx.error(lifetime, "extern type with lifetimes is not supported yet"); + if ety.lang == Lang::Rust { + let msg = "extern Rust type with lifetimes is not supported yet"; + cx.error(lifetime, msg); + } } if !ety.bounds.is_empty() { @@ -447,10 +445,6 @@ fn check_api_type_alias(cx: &mut Check, alias: &TypeAlias) { let msg = format!("derive({}) on extern type alias is not supported", derive); cx.error(derive, msg); } - - if let Some(lifetime) = alias.generics.lifetimes.first() { - cx.error(lifetime, "extern type with lifetimes is not supported yet"); - } } fn check_api_impl(cx: &mut Check, imp: &Impl) { diff --git a/tests/ui/extern_type_lifetime.rs b/tests/ui/extern_type_lifetime.rs deleted file mode 100644 index 4e0e2f7f..00000000 --- a/tests/ui/extern_type_lifetime.rs +++ /dev/null @@ -1,8 +0,0 @@ -#[cxx::bridge] -mod ffi { - extern "C++" { - type Complex<'a, 'b>; - } -} - -fn main() {} diff --git a/tests/ui/extern_type_lifetime.stderr b/tests/ui/extern_type_lifetime.stderr deleted file mode 100644 index 85a5d396..00000000 --- a/tests/ui/extern_type_lifetime.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: extern type with lifetimes is not supported yet - --> $DIR/extern_type_lifetime.rs:4:22 - | -4 | type Complex<'a, 'b>; - | ^^