aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-09-26This test requires the standard libraryPierre-Emmanuel Patry1-0/+1
It requires the standard library and Copy to work correctly which we cannot provide. Stopping the compiler before the name resolution allow us to prevent an error whilst resolving Copy and keep the test's goal. gcc/testsuite/ChangeLog: * rust/compile/functions_without_body.rs: Add compile step argument. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Make node id getter const.Pierre-Emmanuel Patry1-1/+1
gcc/rust/ChangeLog: * ast/rust-ast.h: Node id getter could be const. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Change resolved type segmentPierre-Emmanuel Patry2-2/+12
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.h: Add visit function prototype. * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change resolved type segment. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Update exclude list with working testsPierre-Emmanuel Patry1-26/+1
gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove working tests from nr2 exclude list. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Do not assert insertion resultPierre-Emmanuel Patry1-3/+3
We might have some duplicated name in some pattern and we should therefore not assert the non duplication of identifiers. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Remove assertion and explicitely tells why we ignore the insertion result. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Move bir builder function implementationPierre-Emmanuel Patry3-251/+283
Move function implementation to their own file. gcc/rust/ChangeLog: * Make-lang.in: Add new rust-bir-builder-pattern file. * checks/errors/borrowck/rust-bir-builder-pattern.h: Remove implementation. * checks/errors/borrowck/rust-bir-builder-pattern.cc: New file. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Move failing test to xfailPierre-Emmanuel Patry1-1/+2
We want to begin experimenting with this new name resolution 2.0 algorithm as soon as possible. This test highlight a problem where the compiler should emit an error and should be fixed soon. gcc/testsuite/ChangeLog: * rust/compile/name_resolution21.rs: Move to... * rust/compile/xfail/name_resolution21.rs: ...here. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Make AST default visitor visit functions publicPierre-Emmanuel Patry1-1/+0
Make those functions public so they can be used within a lambda on GCC 4.8. gcc/rust/ChangeLog: * ast/rust-ast-visitor.h: Make visit functions public. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Add default resolver parent functions by defaultPierre-Emmanuel Patry1-0/+2
gcc/rust/ChangeLog: * resolve/rust-finalize-imports-2.0.h: Add parent member functions from default resolver. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Change lambda content with default visitor callPierre-Emmanuel Patry1-70/+13
We can reduce code duplication by using the default visitor functions from within the scoped lambda function. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Use default visitor instead. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Remove regular visit codePierre-Emmanuel Patry2-123/+3
Regular visit code can be replaced with default visit functions. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove default visit code and replace it with call to default visitor. * resolve/rust-default-resolver.h: Remove removed function's prototypes. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Remove empty visit functionsPierre-Emmanuel Patry2-336/+1
We can let the default visitor visit those nodes anyway so we're sure all nodes can be reached. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove empty visit function implementations. * resolve/rust-default-resolver.h: Remove corresponding prototypes. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Mark virtual function override in default resolverPierre-Emmanuel Patry1-89/+89
Those function prototype were not marked as override and throwing warning. gcc/rust/ChangeLog: * resolve/rust-default-resolver.h: Make most visit function override. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Loop on expansion if a new export has been definedPierre-Emmanuel Patry5-5/+21
When a use statement requires a reexported item it cannot find it in the same pass, an additional pass shall be performed. This means we need to detect whether a new item has been reexported and resolve until the end. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::Early): Add dirty flag initialization. (Early::go): Set dirty flag using top level resolver. * resolve/rust-early-name-resolver-2.0.h: Add dirty flag. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::TopLevel): Initialize dirty flag. (TopLevel::insert_or_error_out): Set dirty flag on successful namespace modification. * resolve/rust-toplevel-name-resolver-2.0.h: Add dirty flag. * rust-session-manager.cc (Session::expansion): Modify fixed point condition to include name resolution modifications. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26Fix missing error on duplicated nodesPierre-Emmanuel Patry1-3/+3
When we tried to insert a shadowable node and another shadowable node has been inserted before, we didn't emit any error if the node has already been inserted previously and failed silently. gcc/rust/ChangeLog: * resolve/rust-rib.cc (Rib::insert): Emit an error when trying to insert an already inserted node. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-26nr2.0: Cleanup import mappings and factor into a class.Arthur Cohen4-59/+75
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.h: New class for imports. * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Use the new API. (finalize_glob_import): Likewise. (finalize_rebind_import): Likewise. (FinalizeImports::FinalizeImports): Likewise. (FinalizeImports::visit): Likewise. * resolve/rust-finalize-imports-2.0.h: Likewise. * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): Likewise. (Early::resolve_simple_import): Likewise. (Early::resolve_rebind_import): Likewise.
2024-09-26Insert imports in all namespaces they were resolved inArthur Cohen4-77/+106
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_simple_import): Insert import in all namespaces where they were resolved. (Early::resolve_rebind_import): Likewise. * resolve/rust-early-name-resolver-2.0.h: Improve APIs, make them accept multiple resolutions. * resolve/rust-finalize-imports-2.0.cc: Handle multiple resolutions. * resolve/rust-name-resolution-context.h (resolve_path): Remove function.
2024-09-26early: Do not emit errors for unresolved imports, store them insteadArthur Cohen1-6/+9
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Store errors for later.
2024-09-26imports: Make FinalizeImports a resolver visitor as wellArthur Cohen6-45/+114
gcc/rust/ChangeLog: * resolve/rust-finalize-imports-2.0.cc (FinalizeImports::go): Turn static method into method. (FinalizeImports::visit): New. * resolve/rust-finalize-imports-2.0.h (class FinalizeImports): Make FinalizeImports a visitor. * resolve/rust-early-name-resolver-2.0.cc (Early::go): Use new FinalizeImports API. (Early::resolve_glob_import): Use new API. (Early::resolve_simple_import): Likewise. (Early::resolve_rebind_import): Likewise. (Early::build_import_mapping): Likewise. * resolve/rust-early-name-resolver-2.0.h: Likewise. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Likewise. * resolve/rust-toplevel-name-resolver-2.0.h: Likewise.
2024-09-26imports: Start storing Ribs in ImportKindArthur Cohen3-12/+31
gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add debug call. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Store imports using the new classes. * resolve/rust-toplevel-name-resolver-2.0.h: Use new classes.
2024-09-26imports: Create ImportData class and use it in import_mappingsArthur Cohen6-96/+102
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): Use ImportData class. (Early::resolve_simple_import): Likewise. (Early::resolve_rebind_import): Likewise. (Early::build_import_mapping): Likewise. * resolve/rust-early-name-resolver-2.0.h: Likewise. * resolve/rust-finalize-imports-2.0.cc (finalize_simple_import): Likewise. (finalize_glob_import): Likewise. (finalize_rebind_import): Likewise. (FinalizeImports::go): Likewise. * resolve/rust-finalize-imports-2.0.h: Likewise. * resolve/rust-name-resolution-context.h: Likewise. * resolve/rust-rib.h: Define ImportData class.
2024-09-26imports: Add FinalizeImports classArthur Cohen7-164/+309
gcc/rust/ChangeLog: * Make-lang.in: Add new object file. * ast/rust-item.h: Constify method. * resolve/rust-early-name-resolver-2.0.cc (Early::go): Call into the imports finalizer. (Early::resolve_glob_import): Remove old resolution. (Early::resolve_rebind_import): Likewise. * resolve/rust-toplevel-name-resolver-2.0.cc (GlobbingVisitor::go): New function. (GlobbingVisitor::visit): Likewise. (TopLevel::visit): Do not call into handle_use_* functions anymore. * resolve/rust-toplevel-name-resolver-2.0.h (class GlobbingVisitor): New. * resolve/rust-finalize-imports-2.0.cc: New file. * resolve/rust-finalize-imports-2.0.h: New file.
2024-09-26early: Resolve imports and create import mappingsArthur Cohen4-224/+229
gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_glob_import): New function. (Early::resolve_simple_import): Likewise. (Early::resolve_rebind_import): Likewise. (Early::build_import_mapping): Likewise. * resolve/rust-early-name-resolver-2.0.h: Add declarations and list of imports to resolve. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_glob): Remove function, which is now being handled by the Early name resolver. (TopLevel::handle_use_dec): Likewise. (TopLevel::handle_rebind): Likewise. * resolve/rust-toplevel-name-resolver-2.0.h: Likewise, and add functions for creating import list and fetching it.
2024-09-26toplevel: Build list of imports for Early to resolveArthur Cohen2-15/+81
gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc: Comment out handle_use call and error emission. * resolve/rust-toplevel-name-resolver-2.0.h: Create ImportKind class.
2024-09-26toplevel: Add note for resolving use declarationsArthur Cohen2-1/+12
gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::handle_use_dec): Add notes on the problem. * resolve/rust-toplevel-name-resolver-2.0.h: Likewise.
2024-09-26nr2.0: default-visitor: Conditionally visit type in self parameters.Arthur Cohen1-1/+4
This could trigger an assertions as `get_type` on `SelfParam` asserts that the self param does have a given type, which is not always the case. gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Do not visit self's type if it does not have one.
2024-09-26rust fix ICE when hir lowering qualified path expressions without an asPhilip Herron3-2/+19
Qualified path expressions usually are <X as Y>::... but the as is optional this adds the extra checking in hir lowering to not hit that nullptr. Fixes #3082 gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLowerQualifiedPathInType::visit): check for valid as segment gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3082.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-09-26rust: fix ICE when compiling impl block for !Philip Herron6-5/+49
We need to resolve the never type which is its own special AST node so it doesnt magically get handled like the regular builtin type paths such as i32. Fixes #3035 gcc/rust/ChangeLog: * resolve/rust-ast-resolve-type.cc (ResolveType::visit): handle never type (ResolveTypeToCanonicalPath::visit): likewise * resolve/rust-ast-resolve-type.h: missing never type * resolve/rust-name-resolver.cc (Resolver::generate_builtins): track never type node_id (Resolver::setup_builtin): likewise * resolve/rust-name-resolver.h: new never type getter gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3035.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-09-26Remove some overloaded methods from DefaultResolver.Owen Avery3-121/+0
gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Remove some empty overloads which DefaultASTVisitor::visit should be able to handle. * resolve/rust-default-resolver.h (DefaultResolver::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-09-24Add extra assertions to tl::optionalOwen Avery1-7/+79
gcc/rust/ChangeLog: * util/optional.h (optional): Add assertions to dereference operator overloads when C++14 is available. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-09-23mingw: Fix build with patch from Liu HaoArthur Cohen3-27/+34
This commit adds Liu Hao's patch from https://github.com/lhmouse/MINGW-packages/blob/5859d27b2b6101204a08ad9702cb2937f8797be9/mingw-w64-gcc/0100-rust-fix.patch gcc/rust/ChangeLog: * checks/errors/borrowck/rust-borrow-checker.cc (mkdir_wrapped): Remove. (BorrowChecker::go): Use `mkdir` instead. * expand/rust-proc-macro.cc (register_callback): Use Windows APIs to open dynamic proc macro library. (load_macros_array): Likewise. * parse/rust-parse.cc (defined): Replace separators in paths using std::replace.
2024-09-23gccrs: adjust hir dump of BlockExprMarc Poulhiès1-0/+2
Add tail_reachable and label fields to the dump. gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): Add missing fields. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-09-20rust: negative polarity removes restrictions on validation of impl blocksPhilip Herron4-3/+21
Negative polarity means we can just ignore if any trait items are not implemented. Fxies #3030 gcc/rust/ChangeLog: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): the polarity was reversed * typecheck/rust-hir-type-check-item.cc: check the polarity gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3030.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2024-09-20Fix ICE on error propagation with genericbenjamin.thos2-0/+9
add a resolve expr visitor on error propagation to avoid internal compiler error when used with generics gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Add implementation of error propagation visitor * resolve/rust-ast-resolve-expr.h: Add prototype of error propagation Signed-off-by: benjamin.thos <benjamin.thos@epita.fr>
2024-09-20Adjust expected warnings for alpine 32 bitOwen Avery1-6/+6
ChangeLog: * .github/alpine_32bit_log_warnings: Adjust. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-09-19Check if the type has been correctly resolvedPierre-Emmanuel Patry1-3/+6
We did not check the optional was valid, this lead to rogue dereference and undefined behaviors. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add optional check. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-18Change upload artifact github action versionPierre-Emmanuel Patry1-1/+1
Version 2 of this github action has been deprecated, we shall bump the version used in the CI. ChangeLog: * .github/workflows/bootstrap.yml: Bump version from 2 to 4. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2024-09-18github: adjust footer detection for Tested-byMarc Poulhiès1-4/+2
Add the "Tested-by" prefix to the list of already matched footer prefixes. Adjust the error message. This avoid warnings on commits using it. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-09-17Create new test system for name resolution 2.0Owen Avery2-0/+429
This runs the standard compile/**.rs tests with name resolution 2.0 enabled. The exclude file can be used to exclude tests which are not yet working with name resolution 2.0. gcc/testsuite/ChangeLog: * rust/compile/nr2/compile.exp: New test. * rust/compile/nr2/exclude: New. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-09-16[#3141] Remove double negation by returning CompileExpr::Compile earlyJoanVC1-6/+5
Fixes #3141. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc Signed-off-by: Joan Vilardaga <github-91yu@joanvc.cat>
2024-09-16[#3141] Fix incorrect handling of overflow in numeric typesJoanVC3-5/+133
Fixes #3141. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc: Fix range checking for both integers and floats. * hir/tree/rust-hir-expr.h: Add "negative_number" boolean to LiteralExpr class. gcc/testsuite/ChangeLog: * rust/compile/issue-3141.rs: New test. Signed-off-by: Joan Vilardaga <github-91yu@joanvc.cat>
2024-09-12session-manager: Fix typos in -frust-incomplete messageArthur Cohen1-4/+5
gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Use less repetition, fix a typo in `reports`, fix word order.
2024-09-11Emit error on auto-traitsbenjamin.thos6-0/+16
Throw an error when auto-traits used without feature attribute. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc (FeatureGate::visit): Emit error on trait when auto field member true. * checks/errors/rust-feature-gate.h: add prototype of trait visitor. * checks/errors/rust-feature.cc (Feature::create): add optin_builtin_traits in match of feature. gcc/testsuite/ChangeLog: * rust/compile/auto_trait_super_trait.rs: Add feature attribute. * rust/compile/generic_auto_trait.rs: likewise. * rust/compile/auto_trait.rs: add test for error without feature attribute Signed-off-by: benjamin.thos <benjamin.thos@epita.fr>
2024-09-11gccrs: Implement initial pattern analysis pass.Raiki Tamura8-0/+2225
gcc/rust/ChangeLog: * Make-lang.in: Add rust-hir-pattern-analysis.o. * rust-session-manager.cc (Session::compile_crate): Add pattern analysis pass. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Do typecheck for subpatterns. * checks/errors/rust-hir-pattern-analysis.cc: New file. * checks/errors/rust-hir-pattern-analysis.h: New file. gcc/testsuite/ChangeLog: * rust/compile/exhaustiveness1.rs: New test. * rust/compile/exhaustiveness2.rs: New test. * rust/compile/exhaustiveness3.rs: New test. Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
2024-09-10Compile using ASAN on the github CIOwen Avery2-0/+91
ChangeLog: * .github/workflows/ccpp.yml: Add job for running tests with ASAN. * .github/no-bootstrap-asan.mk: New file. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2024-09-10Dynamic dispatch with supertraitsLiam Naddell9-73/+420
gcc/rust/ChangeLog: * backend/rust-compile.cc: Modify compute_address_for_trait_item to support supertraits * typecheck/rust-tyty.cc: Remove auto gcc/testsuite/ChangeLog: * rust/compile/trait13.rs: Add test for supertraits of supertraits * rust/compile/trait14.rs: Diamond problem with supertraits test * rust/execute/torture/trait14.rs: Add test for dynamic dispatch with supertraits * rust/execute/torture/trait15.rs: Add test for dynamic dispatch with generics * rust/execute/torture/trait16.rs: Add test for dynamic dispatch with lifetime params 1 * rust/execute/torture/trait17.rs: Add test for dynamic dispatch with lifetime params 2 * rust/execute/torture/trait18.rs: Add test for default implementations with dynamic dispatch and supertraits Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
2024-09-09Used `IndexVec` for place_mapKushal Pal2-6/+6
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (Dump::go): Use strong type instead of size_t. (Dump::visit_place): Likewise. (Dump::visit_scope): Likewise. * checks/errors/borrowck/rust-bir-dump.h (class Dump): Use IndeVec for place_map. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
2024-09-09Use `IndexVec` for bb_fold_mapKushal Pal3-15/+17
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Used `IndexVec` for bb_fold_map. (Dump::go): Use strong type as index instead of value as now we are using `IndexVec`. (Dump::visit): Likewise. * checks/errors/borrowck/rust-bir-dump.h (class Dump): Use `IndexVec` for bb_fold_map. * checks/errors/borrowck/rust-bir-place.h: Add constructor for `IndexVec` that can reserve size. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
2024-09-09Used `IndexVec` for PlacesKushal Pal1-29/+27
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Use strong types as index. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
2024-09-09Used `IndexVec` for BasicBlocksKushal Pal6-23/+22
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Use strong type as index and remove access to numeric value. * checks/errors/borrowck/rust-bir-builder-internal.h (struct BuilderContext): Likewise. * checks/errors/borrowck/rust-bir-dump.cc (simplify_cfg): Likewise. (Dump::go): Likewise. (Dump::visit): Likewise. * checks/errors/borrowck/rust-bir-fact-collector.h (class FactCollector): Likewise. (points): Likewise. * checks/errors/borrowck/rust-bir.h (struct BasicBlockId): Used IndexVec for BasicBlocks. (struct Function): Likewise. * checks/errors/borrowck/rust-borrow-checker-diagnostics.cc (BorrowCheckerDiagnostics::get_statement): Change the extracted index to strong type. Signed-off-by: Kushal Pal <kushalpal109@gmail.com>