Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove warnings field from DebugArtifact #5118

Merged
merged 3 commits into from
May 28, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions tooling/debugger/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,13 @@
outputs: vec![],
predicate: None,
}];
let brillig_funcs = &vec![brillig_bytecode];

Check warning on line 672 in tooling/debugger/src/context.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (funcs)
let current_witness_index = 2;
let circuit = &Circuit { current_witness_index, opcodes, ..Circuit::default() };

let debug_symbols = vec![];
let file_map = BTreeMap::new();
let warnings = vec![];
let debug_artifact = &DebugArtifact { debug_symbols, file_map, warnings };
let debug_artifact = &DebugArtifact { debug_symbols, file_map };

let initial_witness = BTreeMap::from([(Witness(1), fe_1)]).into();

Expand All @@ -688,7 +687,7 @@
debug_artifact,
initial_witness,
foreign_call_executor,
brillig_funcs,

Check warning on line 690 in tooling/debugger/src/context.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (funcs)
);

assert_eq!(context.get_current_opcode_location(), Some(OpcodeLocation::Acir(0)));
Expand Down Expand Up @@ -785,21 +784,20 @@

let debug_symbols = vec![];
let file_map = BTreeMap::new();
let warnings = vec![];
let debug_artifact = &DebugArtifact { debug_symbols, file_map, warnings };
let debug_artifact = &DebugArtifact { debug_symbols, file_map };

let initial_witness = BTreeMap::from([(Witness(1), fe_1), (Witness(2), fe_1)]).into();

let foreign_call_executor =
Box::new(DefaultDebugForeignCallExecutor::from_artifact(true, debug_artifact));
let brillig_funcs = &vec![brillig_bytecode];

Check warning on line 793 in tooling/debugger/src/context.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (funcs)
let mut context = DebugContext::new(
&StubbedBlackBoxSolver,
circuit,
debug_artifact,
initial_witness,
foreign_call_executor,
brillig_funcs,

Check warning on line 800 in tooling/debugger/src/context.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (funcs)
);

// set breakpoint
Expand Down Expand Up @@ -843,9 +841,8 @@
Opcode::AssertZero(Expression::default()),
];
let circuit = Circuit { opcodes, ..Circuit::default() };
let debug_artifact =
DebugArtifact { debug_symbols: vec![], file_map: BTreeMap::new(), warnings: vec![] };
let debug_artifact = DebugArtifact { debug_symbols: vec![], file_map: BTreeMap::new() };
let brillig_funcs = &vec![brillig_bytecode];

Check warning on line 845 in tooling/debugger/src/context.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (funcs)
let context = DebugContext::new(
&StubbedBlackBoxSolver,
&circuit,
Expand Down
6 changes: 1 addition & 5 deletions tooling/debugger/src/dap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,7 @@ pub fn run_session<R: Read, W: Write, B: BlackBoxFunctionSolver>(
program: CompiledProgram,
initial_witness: WitnessMap,
) -> Result<(), ServerError> {
let debug_artifact = DebugArtifact {
debug_symbols: program.debug,
file_map: program.file_map,
warnings: program.warnings,
};
let debug_artifact = DebugArtifact { debug_symbols: program.debug, file_map: program.file_map };
let mut session = DapSession::new(
server,
solver,
Expand Down
1 change: 0 additions & 1 deletion tooling/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fm.workspace = true
noirc_abi.workspace = true
noirc_driver.workspace = true
noirc_errors.workspace = true
noirc_evaluator.workspace = true
noirc_frontend.workspace = true
noirc_printable_type.workspace = true
iter-extended.workspace = true
Expand Down
23 changes: 4 additions & 19 deletions tooling/nargo/src/artifacts/debug.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use codespan_reporting::files::{Error, Files, SimpleFile};
use noirc_driver::{CompiledContract, CompiledProgram, DebugFile};
use noirc_errors::{debug_info::DebugInfo, Location};
use noirc_evaluator::errors::SsaReport;
use serde::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, BTreeSet},
Expand All @@ -18,7 +17,6 @@
pub struct DebugArtifact {
pub debug_symbols: Vec<DebugInfo>,
pub file_map: BTreeMap<FileId, DebugFile>,
pub warnings: Vec<SsaReport>,
}

impl DebugArtifact {
Expand All @@ -45,7 +43,7 @@
);
}

Self { debug_symbols, file_map, warnings: Vec::new() }
Self { debug_symbols, file_map }
}

/// Given a location, returns its file's source code
Expand Down Expand Up @@ -121,11 +119,7 @@

impl From<CompiledProgram> for DebugArtifact {
fn from(compiled_program: CompiledProgram) -> Self {
DebugArtifact {
debug_symbols: compiled_program.debug,
file_map: compiled_program.file_map,
warnings: compiled_program.warnings,
}
DebugArtifact { debug_symbols: compiled_program.debug, file_map: compiled_program.file_map }
}
}

Expand All @@ -134,7 +128,6 @@
DebugArtifact {
debug_symbols: program_artifact.debug_symbols.debug_infos,
file_map: program_artifact.file_map,
warnings: Vec::new(),
}
}
}
Expand All @@ -147,11 +140,7 @@
.flat_map(|contract_function| contract_function.debug)
.collect();

DebugArtifact {
debug_symbols: all_functions_debug,
file_map: compiled_artifact.file_map,
warnings: compiled_artifact.warnings,
}
DebugArtifact { debug_symbols: all_functions_debug, file_map: compiled_artifact.file_map }
}
}

Expand All @@ -163,11 +152,7 @@
.flat_map(|contract_function| contract_function.debug_symbols.debug_infos)
.collect();

DebugArtifact {
debug_symbols: all_functions_debug,
file_map: compiled_artifact.file_map,
warnings: Vec::new(),
}
DebugArtifact { debug_symbols: all_functions_debug, file_map: compiled_artifact.file_map }
}
}

Expand Down Expand Up @@ -223,7 +208,7 @@
// For example, given the snippet:
// ```
// permute(
// consts::x5_2_config(),

Check warning on line 211 in tooling/nargo/src/artifacts/debug.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (consts)
// state);
// ```
// We want location_in_line to return the range
Expand All @@ -232,7 +217,7 @@
fn location_in_line_stops_at_end_of_line() {
let source_code = r##"pub fn main(mut state: [Field; 2]) -> [Field; 2] {
state = permute(
consts::x5_2_config(),

Check warning on line 220 in tooling/nargo/src/artifacts/debug.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (consts)
state);

state
Expand All @@ -248,7 +233,7 @@
// Location of
// ```
// permute(
// consts::x5_2_config(),

Check warning on line 236 in tooling/nargo/src/artifacts/debug.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (consts)
// state)
// ```
let loc = Location::new(Span::inclusive(63, 116), file_id);
Expand Down
1 change: 0 additions & 1 deletion tooling/nargo_cli/src/cli/debug_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ pub(crate) fn debug_program(
let debug_artifact = DebugArtifact {
debug_symbols: compiled_program.debug.clone(),
file_map: compiled_program.file_map.clone(),
warnings: compiled_program.warnings.clone(),
};

noir_debugger::debug_circuit(
Expand Down
1 change: 0 additions & 1 deletion tooling/nargo_cli/src/cli/execute_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ pub(crate) fn execute_program(
let debug_artifact = DebugArtifact {
debug_symbols: compiled_program.debug.clone(),
file_map: compiled_program.file_map.clone(),
warnings: compiled_program.warnings.clone(),
};

if let Some(diagnostic) =
Expand Down
Loading