Skip to content

Commit 24d4a8b

Browse files
committed
Remove opaque C++ type lifetimes gates
1 parent 3a48021 commit 24d4a8b

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

syntax/check.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ fn check_type_ident(cx: &mut Check, name: &NamedType) {
7171
{
7272
let msg = format!("unsupported type: {}", ident);
7373
cx.error(ident, &msg);
74-
return;
75-
}
76-
77-
if !name.generics.lifetimes.is_empty() {
78-
cx.error(name, "type with lifetime parameter is not supported yet");
7974
}
8075
}
8176

@@ -341,7 +336,10 @@ fn check_api_type(cx: &mut Check, ety: &ExternType) {
341336
}
342337

343338
if let Some(lifetime) = ety.generics.lifetimes.first() {
344-
cx.error(lifetime, "extern type with lifetimes is not supported yet");
339+
if ety.lang == Lang::Rust {
340+
let msg = "extern Rust type with lifetimes is not supported yet";
341+
cx.error(lifetime, msg);
342+
}
345343
}
346344

347345
if !ety.bounds.is_empty() {
@@ -447,10 +445,6 @@ fn check_api_type_alias(cx: &mut Check, alias: &TypeAlias) {
447445
let msg = format!("derive({}) on extern type alias is not supported", derive);
448446
cx.error(derive, msg);
449447
}
450-
451-
if let Some(lifetime) = alias.generics.lifetimes.first() {
452-
cx.error(lifetime, "extern type with lifetimes is not supported yet");
453-
}
454448
}
455449

456450
fn check_api_impl(cx: &mut Check, imp: &Impl) {

tests/ui/extern_type_lifetime.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/ui/extern_type_lifetime.stderr

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)