Skip to content

Commit

Permalink
Rewrite compile failure tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ymadzhunkov committed Sep 26, 2023
1 parent 2d72406 commit 88ac58d
Show file tree
Hide file tree
Showing 32 changed files with 1,016 additions and 735 deletions.
1 change: 1 addition & 0 deletions compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub struct DefCollector {
pub(crate) collected_traits_impls: TraitImplMap,
}

#[derive(Debug, Clone)]
pub enum CompilationError {
ParseError(ParserError),
DefinitionError(DefCollectorErrorKind),
Expand Down
4 changes: 2 additions & 2 deletions compiler/noirc_frontend/src/hir/def_collector/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use thiserror::Error;

use std::fmt;

#[derive(Debug, Eq, PartialEq)]
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum DuplicateType {
Function,
Module,
Expand All @@ -18,7 +18,7 @@ pub enum DuplicateType {
TraitImplementation,
}

#[derive(Error, Debug)]
#[derive(Error, Debug, Clone)]
pub enum DefCollectorErrorKind {
#[error("duplicate {typ} found in namespace")]
Duplicate { typ: DuplicateType, first_def: Ident, second_def: Ident },
Expand Down
4 changes: 1 addition & 3 deletions compiler/noirc_frontend/src/hir/def_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ pub struct Contract {
/// Given a FileId, fetch the File, from the FileManager and parse it's content
pub fn parse_file(fm: &FileManager, file_id: FileId) -> (ParsedModule, Vec<ParserError>) {
let file = fm.fetch_file(file_id);
let (program, errors) = parse_program(file.source());

(program, errors)
parse_program(file.source())
}

impl std::ops::Index<LocalModuleId> for CrateDefMap {
Expand Down
Loading

0 comments on commit 88ac58d

Please sign in to comment.