-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Various local trait item iteration cleanups #139018
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
Changes from all commits
a7b687c
aec7739
c0fe46d
23f1fb5
2b1c416
51184c7
ca32447
6697f02
7192a06
062ef53
7989879
49c74d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,9 +53,13 @@ impl<'tcx> ConstMutationChecker<'_, 'tcx> { | |
// | ||
// #[const_mutation_allowed] | ||
// pub const LOG: Log = Log { msg: "" }; | ||
match self.tcx.calculate_dtor(def_id, |_, _| Ok(())) { | ||
Some(_) => None, | ||
None => Some(def_id), | ||
// FIXME: this should not be checking for `Drop` impls, | ||
// but whether it or any field has a Drop impl (`needs_drop`) | ||
// as fields' Drop impls may make this observable, too. | ||
match self.tcx.type_of(def_id).skip_binder().ty_adt_def().map(|adt| adt.has_dtor(self.tcx)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This logic seems kinda sketch lol. Do we want to check that the type of the const There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's preexisting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe fixme here rather than changing it, since it's possibly public facing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll check if we want direct impls explicitly and leave a fixme if that's so or a comment otherwise |
||
{ | ||
Some(true) => None, | ||
Some(false) | None => Some(def_id), | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously this was using the
def_id
of the const, which accidentally worked because the query invokedtype_of
on it internally.