Closed
Description
While trying to migrate sv-parser
0.11.1 to the 2021 edition, the compiler fails with this error:
error[E0275]: overflow evaluating the requirement `Box<sv_parser::ValueRangeBinary>: Sync`
It is hard to create a small reproduction, but here is the command to run in that package to reproduce the error:
cargo rustc --profile=check --example module_list -v -- --force-warn rust-2021-incompatible-closure-captures -Zunstable-options
I'm not sure if it is feasible to avoid this. I'm guessing that the lint is doing some kind of trait evaluation that happens to add some additional recursion that is not normally there. Adding #![recursion_limit="256"]
fixes the problem. Opening this issue to track whether or not there is anything to do here.
Note that the lint doesn't actually fire, so this is just during the analysis (presumably somewhere in compute_2229_migrations
).
Full error:
error[E0275]: overflow evaluating the requirement `Box<sv_parser::ValueRangeBinary>: Sync`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`module_list`)
= note: required because it appears within the type `sv_parser::ValueRange`
= note: required because it appears within the type `(sv_parser::ValueRange, std::option::Option<sv_parser::DistWeight>)`
= note: required because it appears within the type `sv_parser::DistItem`
= note: required because it appears within the type `(sv_parser::DistItem, Vec<(sv_parser::Symbol, sv_parser::DistItem)>)`
= note: required because it appears within the type `sv_parser::List<sv_parser::Symbol, sv_parser::DistItem>`
= note: required because it appears within the type `(sv_parser::List<sv_parser::Symbol, sv_parser::DistItem>,)`
= note: required because it appears within the type `sv_parser::DistList`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::DistList, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::Brace<sv_parser::DistList>`
= note: required because it appears within the type `(sv_parser::Keyword, sv_parser::Brace<sv_parser::DistList>)`
= note: required because it appears within the type `std::option::Option<(sv_parser::Keyword, sv_parser::Brace<sv_parser::DistList>)>`
= note: required because it appears within the type `(sv_parser::Expression, std::option::Option<(sv_parser::Keyword, sv_parser::Brace<sv_parser::DistList>)>)`
= note: required because it appears within the type `sv_parser::ExpressionOrDist`
= note: required because it appears within the type `(sv_parser::ExpressionOrDist, std::option::Option<sv_parser::BooleanAbbrev>)`
= note: required because it appears within the type `sv_parser::SequenceExprExpression`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::SequenceExprExpression>`
= note: required because it appears within the type `Box<sv_parser::SequenceExprExpression>`
= note: required because it appears within the type `sv_parser::SequenceExpr`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::SequenceExpr>`
= note: required because it appears within the type `Box<sv_parser::SequenceExpr>`
= note: required because it appears within the type `sv_parser::SequenceActualArg`
= note: required because it appears within the type `std::option::Option<sv_parser::SequenceActualArg>`
= note: required because it appears within the type `(std::option::Option<sv_parser::SequenceActualArg>, Vec<(sv_parser::Symbol, std::option::Option<sv_parser::SequenceActualArg>)>)`
= note: required because it appears within the type `sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::SequenceActualArg>>`
= note: required because it appears within the type `(sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::SequenceActualArg>>, Vec<(sv_parser::Symbol, sv_parser::Symbol, sv_parser::Identifier, sv_parser::Paren<std::option::Option<sv_parser::SequenceActualArg>>)>)`
= note: required because it appears within the type `sv_parser::SequenceListOfArgumentsOrdered`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::SequenceListOfArgumentsOrdered>`
= note: required because it appears within the type `Box<sv_parser::SequenceListOfArgumentsOrdered>`
= note: required because it appears within the type `sv_parser::SequenceListOfArguments`
= note: required because it appears within the type `std::option::Option<sv_parser::SequenceListOfArguments>`
= note: required because it appears within the type `(sv_parser::Symbol, std::option::Option<sv_parser::SequenceListOfArguments>, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::Paren<std::option::Option<sv_parser::SequenceListOfArguments>>`
= note: required because it appears within the type `std::option::Option<sv_parser::Paren<std::option::Option<sv_parser::SequenceListOfArguments>>>`
= note: required because it appears within the type `(sv_parser::PsOrHierarchicalSequenceIdentifier, std::option::Option<sv_parser::Paren<std::option::Option<sv_parser::SequenceListOfArguments>>>)`
= note: required because it appears within the type `sv_parser::SequenceInstance`
= note: required because it appears within the type `(sv_parser::SequenceInstance, std::option::Option<(sv_parser::Keyword, sv_parser::Expression)>)`
= note: required because it appears within the type `sv_parser::EventExpressionSequence`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::EventExpressionSequence>`
= note: required because it appears within the type `Box<sv_parser::EventExpressionSequence>`
= note: required because it appears within the type `sv_parser::EventExpression`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::EventExpression, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::Paren<sv_parser::EventExpression>`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::Paren<sv_parser::EventExpression>)`
= note: required because it appears within the type `sv_parser::ClockingEventExpression`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::ClockingEventExpression>`
= note: required because it appears within the type `Box<sv_parser::ClockingEventExpression>`
= note: required because it appears within the type `sv_parser::ClockingEvent`
= note: required because it appears within the type `std::option::Option<sv_parser::ClockingEvent>`
= note: required because it appears within the type `(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)`
= note: required because it appears within the type `std::option::Option<(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)>`
= note: required because it appears within the type `(sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::Expression>>, std::option::Option<(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)>)`
= note: required because it appears within the type `(sv_parser::Symbol, (sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::Expression>>, std::option::Option<(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)>), sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::Paren<(sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::Expression>>, std::option::Option<(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)>)>`
= note: required because it appears within the type `(sv_parser::SystemTfIdentifier, sv_parser::Paren<(sv_parser::List<sv_parser::Symbol, std::option::Option<sv_parser::Expression>>, std::option::Option<(sv_parser::Symbol, std::option::Option<sv_parser::ClockingEvent>)>)>)`
= note: required because it appears within the type `sv_parser::SystemTfCallArgExpression`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::SystemTfCallArgExpression>`
= note: required because it appears within the type `Box<sv_parser::SystemTfCallArgExpression>`
= note: required because it appears within the type `sv_parser::SystemTfCall`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::SystemTfCall>`
= note: required because it appears within the type `Box<sv_parser::SystemTfCall>`
= note: required because it appears within the type `sv_parser::SubroutineCall`
= note: required because it appears within the type `(sv_parser::SubroutineCall,)`
= note: required because it appears within the type `sv_parser::FunctionSubroutineCall`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::FunctionSubroutineCall>`
= note: required because it appears within the type `Box<sv_parser::FunctionSubroutineCall>`
= note: required because it appears within the type `sv_parser::Primary`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::Primary>`
= note: required because it appears within the type `Box<sv_parser::Primary>`
= note: required because it appears within the type `sv_parser::Expression`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::Expression>`
= note: required because it appears within the type `Box<sv_parser::Expression>`
= note: required because it appears within the type `sv_parser::MintypmaxExpression`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::MintypmaxExpression>`
= note: required because it appears within the type `Box<sv_parser::MintypmaxExpression>`
= note: required because it appears within the type `sv_parser::ParamExpression`
= note: required because it appears within the type `(sv_parser::ParamExpression,)`
= note: required because it appears within the type `sv_parser::OrderedParameterAssignment`
= note: required because it appears within the type `(sv_parser::OrderedParameterAssignment, Vec<(sv_parser::Symbol, sv_parser::OrderedParameterAssignment)>)`
= note: required because it appears within the type `sv_parser::List<sv_parser::Symbol, sv_parser::OrderedParameterAssignment>`
= note: required because it appears within the type `(sv_parser::List<sv_parser::Symbol, sv_parser::OrderedParameterAssignment>,)`
= note: required because it appears within the type `sv_parser::ListOfParameterAssignmentsOrdered`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::ListOfParameterAssignmentsOrdered>`
= note: required because it appears within the type `Box<sv_parser::ListOfParameterAssignmentsOrdered>`
= note: required because it appears within the type `sv_parser::ListOfParameterAssignments`
= note: required because it appears within the type `std::option::Option<sv_parser::ListOfParameterAssignments>`
= note: required because it appears within the type `(sv_parser::Symbol, std::option::Option<sv_parser::ListOfParameterAssignments>, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::Paren<std::option::Option<sv_parser::ListOfParameterAssignments>>`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::Paren<std::option::Option<sv_parser::ListOfParameterAssignments>>)`
= note: required because it appears within the type `sv_parser::ParameterValueAssignment`
= note: required because it appears within the type `std::option::Option<sv_parser::ParameterValueAssignment>`
= note: required because it appears within the type `(sv_parser::PsClassIdentifier, std::option::Option<sv_parser::ParameterValueAssignment>, Vec<(sv_parser::Symbol, sv_parser::ClassIdentifier, std::option::Option<sv_parser::ParameterValueAssignment>)>)`
= note: required because it appears within the type `sv_parser::ClassType`
= note: required because it appears within the type `(sv_parser::ClassType, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::ClassScope`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::ClassScope>`
= note: required because it appears within the type `Box<sv_parser::ClassScope>`
= note: required because it appears within the type `sv_parser::PackageScopeOrClassScope`
= note: required because it appears within the type `std::option::Option<sv_parser::PackageScopeOrClassScope>`
= note: required because it appears within the type `(std::option::Option<sv_parser::PackageScopeOrClassScope>, sv_parser::ParameterIdentifier)`
= note: required because it appears within the type `sv_parser::PsParameterIdentifierScope`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::PsParameterIdentifierScope>`
= note: required because it appears within the type `Box<sv_parser::PsParameterIdentifierScope>`
= note: required because it appears within the type `sv_parser::PsParameterIdentifier`
= note: required because it appears within the type `(sv_parser::PsParameterIdentifier, sv_parser::ConstantSelect)`
= note: required because it appears within the type `sv_parser::ConstantPrimaryPsParameter`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::ConstantPrimaryPsParameter>`
= note: required because it appears within the type `Box<sv_parser::ConstantPrimaryPsParameter>`
= note: required because it appears within the type `sv_parser::ConstantPrimary`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::ConstantPrimary>`
= note: required because it appears within the type `Box<sv_parser::ConstantPrimary>`
= note: required because it appears within the type `sv_parser::ConstantExpression`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::ConstantExpression)`
= note: required because it appears within the type `std::option::Option<(sv_parser::Symbol, sv_parser::ConstantExpression)>`
= note: required because it appears within the type `(sv_parser::Identifier, std::option::Option<(sv_parser::Symbol, sv_parser::ConstantExpression)>)`
= note: required because it appears within the type `sv_parser::AttrSpec`
= note: required because it appears within the type `(sv_parser::AttrSpec, Vec<(sv_parser::Symbol, sv_parser::AttrSpec)>)`
= note: required because it appears within the type `sv_parser::List<sv_parser::Symbol, sv_parser::AttrSpec>`
= note: required because it appears within the type `(sv_parser::Symbol, sv_parser::List<sv_parser::Symbol, sv_parser::AttrSpec>, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::AttributeInstance`
= note: required because of the requirements on the impl of `Sync` for `std::ptr::Unique<sv_parser::AttributeInstance>`
= note: required because it appears within the type `alloc::raw_vec::RawVec<sv_parser::AttributeInstance>`
= note: required because it appears within the type `Vec<sv_parser::AttributeInstance>`
= note: required because it appears within the type `(Vec<sv_parser::AttributeInstance>, sv_parser::ModuleKeyword, std::option::Option<sv_parser::Lifetime>, sv_parser::ModuleIdentifier, Vec<sv_parser::PackageImportDeclaration>, std::option::Option<sv_parser::ParameterPortList>, sv_parser::ListOfPorts, sv_parser::Symbol)`
= note: required because it appears within the type `sv_parser::ModuleNonansiHeader`
= note: required because it appears within the type `(sv_parser::ModuleNonansiHeader, std::option::Option<sv_parser::TimeunitsDeclaration>, Vec<sv_parser::ModuleItem>, sv_parser::Keyword, std::option::Option<(sv_parser::Symbol, sv_parser::ModuleIdentifier)>)`
= note: required because it appears within the type `sv_parser::ModuleDeclarationNonansi`
= note: required because it appears within the type `&sv_parser::ModuleDeclarationNonansi`
= note: required because it appears within the type `&&sv_parser::ModuleDeclarationNonansi`
For more information about this error, try `rustc --explain E0275`.
Meta
rustc --version --verbose
:
rustc 1.56.0-nightly (8007b506a 2021-08-14)
binary: rustc
commit-hash: 8007b506ac5da629f223b755f5a5391edd5f6d01
commit-date: 2021-08-14
host: x86_64-apple-darwin
release: 1.56.0-nightly
LLVM version: 12.0.1
cc @rust-lang/wg-rfc-2229