mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 20:01:22 -05:00
gccrs: Clear the substitution callbacks when copying ArgumentMappings
When we set the callback on substitutions this is not safe to be copied around since we store the used argument mappings and can reuse them in different contexts. This clears the callback on copy's to make it safer. Signed-off-by: Philip Herron <herron.philip@googlemail.com> gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.cc: update copy constructors
This commit is contained in:
committed by
Arthur Cohen
parent
dcb2e571ac
commit
2f228578d5
@@ -241,7 +241,7 @@ SubstitutionArgumentMappings::SubstitutionArgumentMappings (
|
||||
SubstitutionArgumentMappings::SubstitutionArgumentMappings (
|
||||
const SubstitutionArgumentMappings &other)
|
||||
: mappings (other.mappings), binding_args (other.binding_args),
|
||||
locus (other.locus), param_subst_cb (other.param_subst_cb),
|
||||
locus (other.locus), param_subst_cb (nullptr),
|
||||
trait_item_flag (other.trait_item_flag)
|
||||
{}
|
||||
|
||||
@@ -252,7 +252,7 @@ SubstitutionArgumentMappings::operator= (
|
||||
mappings = other.mappings;
|
||||
binding_args = other.binding_args;
|
||||
locus = other.locus;
|
||||
param_subst_cb = other.param_subst_cb;
|
||||
param_subst_cb = nullptr;
|
||||
trait_item_flag = other.trait_item_flag;
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user