aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-05-20 13:30:06 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2022-05-20 13:35:33 +0200
commitb0527990a14efd5abb857ea7edfd96c7ad78792e (patch)
treeae7bea4a2b13b1052e7a998104bb6aaff7e1c429 /gcc
parent3c31c11393b630e59d189e815af0fe7ea47fdd31 (diff)
downloadgcc-b0527990a14efd5abb857ea7edfd96c7ad78792e.zip
gcc-b0527990a14efd5abb857ea7edfd96c7ad78792e.tar.gz
gcc-b0527990a14efd5abb857ea7edfd96c7ad78792e.tar.bz2
privacy: PrivacyReporter: Handle builtin and unimplemented types better
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/privacy/rust-privacy-reporter.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/rust/privacy/rust-privacy-reporter.cc b/gcc/rust/privacy/rust-privacy-reporter.cc
index 1685a96..4b010a0 100644
--- a/gcc/rust/privacy/rust-privacy-reporter.cc
+++ b/gcc/rust/privacy/rust-privacy-reporter.cc
@@ -163,11 +163,9 @@ PrivacyReporter::check_base_type_privacy (Analysis::NodeMapping &node_mappings,
case TyTy::PROJECTION:
return recursive_check (
static_cast<const TyTy::ProjectionType *> (ty)->get ());
- case TyTy::NEVER:
case TyTy::CLOSURE:
- case TyTy::ERROR:
- case TyTy::INFER:
- rust_unreachable ();
+ sorry_at (locus.gcc_location (),
+ "privacy pass for closures is not handled yet");
break;
// If we're dealing with a generic param, there's nothing we should be
@@ -180,7 +178,13 @@ PrivacyReporter::check_base_type_privacy (Analysis::NodeMapping &node_mappings,
// FIXME: Can we really not resolve Dynamic types here? Shouldn't we have
// a look at the path and perform proper privacy analysis?
case TyTy::DYNAMIC:
+ // The never type is builtin and always available
+ case TyTy::NEVER:
+ // We shouldn't have inference types here, ever
+ case TyTy::INFER:
return;
+ case TyTy::ERROR:
+ rust_unreachable ();
}
}