File tree Expand file tree Collapse file tree 3 files changed +18
-23
lines changed Expand file tree Collapse file tree 3 files changed +18
-23
lines changed Original file line number Diff line number Diff line change @@ -261,22 +261,22 @@ impl<'a> AnalyzeContext<'a> {
261261 expected,
262262 ) ?;
263263
264- if let AnyEntKind :: Design ( Design :: Entity ( library_name, _, ent_region) ) =
265- ent. kind ( )
266- {
264+ if let AnyEntKind :: Design ( Design :: Entity ( _, ent_region) ) = ent. kind ( ) {
267265 if let Designator :: Identifier ( entity_ident) = ent. designator ( ) {
268- if let Some ( ref mut architecture_name) = architecture_name {
269- match self . get_architecture (
270- library_name,
271- & architecture_name. item . pos ,
272- entity_ident,
273- & architecture_name. item . item ,
274- ) {
275- Ok ( arch) => {
276- architecture_name. set_unique_reference ( & arch) ;
277- }
278- Err ( err) => {
279- diagnostics. push ( err. into_non_fatal ( ) ?) ;
266+ if let Some ( library_name) = ent. library_name ( ) {
267+ if let Some ( ref mut architecture_name) = architecture_name {
268+ match self . get_architecture (
269+ library_name,
270+ & architecture_name. item . pos ,
271+ entity_ident,
272+ & architecture_name. item . item ,
273+ ) {
274+ Ok ( arch) => {
275+ architecture_name. set_unique_reference ( & arch) ;
276+ }
277+ Err ( err) => {
278+ diagnostics. push ( err. into_non_fatal ( ) ?) ;
279+ }
280280 }
281281 }
282282 }
Original file line number Diff line number Diff line change @@ -74,11 +74,7 @@ impl<'a> AnalyzeContext<'a> {
7474 let region = primary_scope. into_region ( ) ;
7575 let visibility = root_scope. into_visibility ( ) ;
7676
77- let kind = AnyEntKind :: Design ( Design :: Entity (
78- self . work_library_name ( ) . clone ( ) ,
79- visibility,
80- region,
81- ) ) ;
77+ let kind = AnyEntKind :: Design ( Design :: Entity ( visibility, region) ) ;
8278 unsafe { ent. set_kind ( kind) }
8379
8480 Ok ( ( ) )
@@ -231,7 +227,7 @@ impl<'a> AnalyzeContext<'a> {
231227 self . check_secondary_before_primary ( & primary, unit. pos ( ) , diagnostics) ;
232228
233229 let ( visibility, region) =
234- if let Design :: Entity ( _ , ref visibility, ref region) = primary. kind ( ) {
230+ if let Design :: Entity ( ref visibility, ref region) = primary. kind ( ) {
235231 ( visibility, region)
236232 } else {
237233 let mut diagnostic = Diagnostic :: error ( unit. pos ( ) , "Expected an entity" ) ;
Original file line number Diff line number Diff line change @@ -15,13 +15,12 @@ use crate::analysis::visibility::Visibility;
1515use crate :: ast:: Designator ;
1616use crate :: ast:: HasDesignator ;
1717use crate :: ast:: WithRef ;
18- use crate :: data:: Symbol ;
1918use crate :: data:: WithPos ;
2019use crate :: Diagnostic ;
2120use crate :: SrcPos ;
2221
2322pub enum Design < ' a > {
24- Entity ( Symbol , Visibility < ' a > , Region < ' a > ) ,
23+ Entity ( Visibility < ' a > , Region < ' a > ) ,
2524 Architecture ( DesignEnt < ' a > ) ,
2625 Configuration ,
2726 Package ( Visibility < ' a > , Region < ' a > ) ,
You can’t perform that action at this time.
0 commit comments