@@ -4,7 +4,6 @@ use core::fmt::{Display, Formatter};
44use core:: str:: Utf8Error ;
55
66use super :: indices:: FuncIdx ;
7- use crate :: core:: reader:: section_header:: SectionTy ;
87use crate :: core:: reader:: types:: ValType ;
98
109#[ derive( Debug , PartialEq , Eq , Clone ) ]
@@ -71,8 +70,8 @@ pub enum ValidationError {
7170 /// An index for a lane of some vector type is invalid.
7271 InvalidLaneIdx ( u8 ) ,
7372
74- /// A section with given type is out of order. All section types have a fixed order in which they must occur .
75- SectionOutOfOrder ( SectionTy ) ,
73+ /// The last section was read, but there is still content in the bytecode .
74+ UnexpectedContentAfterLastSection ,
7675 /// A custom section contains more bytes than its section header specifies.
7776 InvalidCustomSectionLength ,
7877 ExprMissingEnd ,
@@ -201,7 +200,7 @@ impl Display for ValidationError {
201200 ValidationError :: InvalidLabelIdx ( idx) => write ! ( f, "The label index {idx} is invalid" ) ,
202201 ValidationError :: InvalidLaneIdx ( idx) => write ! ( f, "The lane index {idx} is invalid" ) ,
203202
204- ValidationError :: SectionOutOfOrder ( ty ) => write ! ( f, "A section of type `{ty:?}` is defined out of order " ) ,
203+ ValidationError :: UnexpectedContentAfterLastSection => write ! ( f, "The last section was read, but there is still content in the bytecode " ) ,
205204 ValidationError :: InvalidCustomSectionLength => write ! ( f, "A custom section contains more bytes than its section header specifies" ) ,
206205 ValidationError :: ExprMissingEnd => write ! ( f, "An expr type is missing an end byte" ) ,
207206 ValidationError :: InvalidInstr ( byte) => write ! ( f, "The instruction opcode {byte:#x} is invalid" ) ,
0 commit comments