Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum RuntimeError {
InternalError(#[from] InternalError),
#[error("Range constraint of {num_bits} bits is too large for the Field size")]
InvalidRangeConstraint { num_bits: u32, call_stack: CallStack },
#[error("The value `{value:?}` cannot fit into `{typ}` which has range `{range}`")]
#[error("The value `{value}` cannot fit into `{typ}` which has range `{range}`")]
IntegerOutOfBounds {
value: SignedField,
typ: NumericType,
Expand Down
22 changes: 14 additions & 8 deletions compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,22 @@ impl DefCollector {
) {
let unused_imports = context.usage_tracker.unused_items().iter();
let unused_imports = unused_imports.filter(|(module_id, _)| module_id.krate == crate_id);

errors.extend(unused_imports.flat_map(|(_, usage_tracker)| {
usage_tracker.iter().map(|(ident, unused_item)| {
let ident = ident.clone();
CompilationError::ResolverError(ResolverError::UnusedItem {
ident,
item: *unused_item,
let mut unused_errors = unused_imports
.flat_map(|(_, unused_items)| {
unused_items.iter().map(|(ident, unused_item)| {
let ident = ident.clone();
CompilationError::ResolverError(ResolverError::UnusedItem {
ident,
item: *unused_item,
})
})
})
}));
.collect::<Vec<_>>();

// Make sure errors always show up in the same order when compiling the same codebase
unused_errors.sort_by_key(|error| error.location());

errors.extend(unused_errors);
}
}

Expand Down
Loading
Loading