Merge pull request #85179 from xymus/exportability-nle-structs

Sema: Opt-in check for structs references to hidden dependencies in non-library-evolution mode
This commit is contained in:
Alexis Laferrière
2025-11-05 15:32:05 -08:00
committed by GitHub
12 changed files with 295 additions and 15 deletions

View File

@@ -3847,7 +3847,8 @@ ERROR(decl_from_hidden_module,none,
"%2 was not imported by this file|"
"C++ types from imported module %2 do not support library evolution|"
"it was imported via the internal bridging header|"
"%2 was not imported publicly}3",
"%2 was not imported publicly|"
"it is a struct marked '@_implementationOnly'}3",
(const Decl *, unsigned, Identifier, unsigned))
ERROR(typealias_desugars_to_type_from_hidden_module,none,
"%0 aliases '%1.%2' and cannot be used %select{here|"
@@ -3865,7 +3866,8 @@ ERROR(typealias_desugars_to_type_from_hidden_module,none,
"%4 was not imported by this file|"
"C++ types from imported module %4 do not support library evolution|"
"it was imported via the internal bridging header|"
"%4 was not imported publicly}5",
"%4 was not imported publicly|"
"it is a struct marked '@_implementationOnly'}5",
(const TypeAliasDecl *, StringRef, StringRef, unsigned, Identifier, unsigned))
ERROR(conformance_from_implementation_only_module,none,
"cannot use conformance of %0 to %1 %select{here|as property wrapper here|"
@@ -3881,7 +3883,8 @@ ERROR(conformance_from_implementation_only_module,none,
"%3 was not imported by this file|"
"C++ types from imported module %3 do not support library evolution|"
"it was imported via the internal bridging header|"
"%3 was not imported publicly}4",
"%3 was not imported publicly|"
"it is a struct marked '@_implementationOnly'}4",
(Type, Identifier, unsigned, Identifier, unsigned))
NOTE(assoc_conformance_from_implementation_only_module,none,
"in associated type %0 (inferred as %1)", (Type, Type))
@@ -3946,6 +3949,9 @@ ERROR(implementation_only_override_import_without_attr,none,
"override of %kindonly0 imported as implementation-only must be declared "
"'@_implementationOnly'",
(const ValueDecl *))
ERROR(implementation_only_on_structs_feature,none,
"'@_implementationOnly' on structs requires "
"'-enable-experimental-feature CheckImplementationOnly'", ())
ERROR(import_attr_conflict,none,
"%0 inconsistently imported with %1",
@@ -4128,7 +4134,7 @@ WARNING(attr_has_no_effect_on_decl_with_access_level,none,
(DeclAttribute, AccessLevel))
ERROR(attr_not_on_decl_with_invalid_access_level,none,
"'%0' may not be used on "
"%select{private|fileprivate|internal|package|%error|%error}1 declarations",
"%select{private|fileprivate|internal|package|public|%error}1 declarations",
(DeclAttribute, AccessLevel))
ERROR(attr_has_no_effect_decl_not_available_before,none,
@@ -7350,7 +7356,8 @@ ERROR(inlinable_decl_ref_from_hidden_module,
"%2 was not imported by this file|"
"C++ APIs from imported module %2 do not support library evolution|"
"it was imported via the internal bridging header|"
"%2 was not imported publicly}3",
"%2 was not imported publicly|"
"it is a struct marked '@_implementationOnly'}3",
(const ValueDecl *, unsigned, Identifier, unsigned))
ERROR(inlinable_typealias_desugars_to_type_from_hidden_module,
@@ -7362,7 +7369,8 @@ ERROR(inlinable_typealias_desugars_to_type_from_hidden_module,
"%4 was not imported by this file|"
"C++ types from imported module %4 do not support library evolution|"
"it was imported via the internal bridging header|"
"%4 was not imported publicly}5",
"%4 was not imported publicly|"
"it is a struct marked '@_implementationOnly'}5",
(const TypeAliasDecl *, StringRef, StringRef, unsigned, Identifier, unsigned))
NOTE(missing_import_inserted,