@@ -360,7 +360,7 @@ impl DocValidationScope<'_> {
360
360
) -> Result < UnionDatatype , ValidationError > {
361
361
let mut variant_scope = IdentValidation :: new ( ) ;
362
362
let tag_id = self . get ( & syntax. tag ) ?;
363
- let ( tag, tagname , mut variant_name_uses) = match self . doc . entries . get ( & tag_id) {
363
+ let ( tag, mut variant_name_uses) = match self . doc . entries . get ( & tag_id) {
364
364
Some ( Entry :: Typename ( weak_ref) ) => {
365
365
let named_dt = weak_ref. upgrade ( ) . expect ( "weak backref to defined type" ) ;
366
366
match & * named_dt. type_ ( ) {
@@ -370,8 +370,7 @@ impl DocValidationScope<'_> {
370
370
. iter ( )
371
371
. map ( |v| ( v. name . clone ( ) , false ) )
372
372
. collect :: < HashMap < Id , bool > > ( ) ;
373
- let name = named_dt. name . clone ( ) ;
374
- Ok ( ( TypeRef :: Name ( named_dt) , name, uses) )
373
+ Ok ( ( named_dt, uses) )
375
374
}
376
375
other => Err ( ValidationError :: WrongKindName {
377
376
name : syntax. tag . name ( ) . to_string ( ) ,
@@ -425,7 +424,7 @@ impl DocValidationScope<'_> {
425
424
name : variant_name. name ( ) . to_string ( ) ,
426
425
reason : format ! (
427
426
"does not correspond to variant in tag `{}`" ,
428
- tagname . as_str( )
427
+ tag . name . as_str( )
429
428
) ,
430
429
location : self . location ( variant_name. span ( ) ) ,
431
430
} ) ?,
@@ -446,7 +445,7 @@ impl DocValidationScope<'_> {
446
445
. map ( |i| i. as_str ( ) )
447
446
. collect :: < Vec < _ > > ( )
448
447
. join ( ", " ) ,
449
- reason : format ! ( "missing variants from tag `{}`" , tagname . as_str( ) ) ,
448
+ reason : format ! ( "missing variants from tag `{}`" , tag . name . as_str( ) ) ,
450
449
location : self . location ( span) ,
451
450
} ) ?;
452
451
}
0 commit comments