Skip to content

Rollup of 8 pull requests #108027

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

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7824528
std: use id-based thread parking on SOLID
joboet Dec 31, 2022
837c1af
rework min_choice algorithm of member constraints
aliemjay Jan 15, 2023
8df27d0
Remove some superfluous type parameters from layout.rs.
mikebenfield Jan 21, 2023
e813132
--wip-- [skip ci]
spanishpear Oct 23, 2022
5287004
Apply automatic suggestions from code review
spanishpear Dec 1, 2022
655beb4
Attempt to address review comments via github web...
spanishpear Dec 1, 2022
4447949
revert to previous span
spanishpear Jan 22, 2023
8292d07
move tests to new rust-lang location
spanishpear Jan 22, 2023
70bfcc2
move to multipart spans
spanishpear Jan 31, 2023
a3d32bb
fix formatting + test syntax
spanishpear Feb 1, 2023
0d59b8c
Remove redundant test.
cjgillot Jan 21, 2023
cd3649b
Only exclude locals if the place is not indirect.
cjgillot Jan 21, 2023
9a6c04f
Handle discriminants in dataflow-const-prop.
cjgillot Jan 21, 2023
c48756c
Limit creation of tracked place directly.
cjgillot Jan 28, 2023
9af191f
Improve value_analysis API.
cjgillot Jan 29, 2023
67a8c16
Complete for_each_aliasing_place.
cjgillot Jan 30, 2023
df889c9
Rename assign_idx methods.
cjgillot Feb 3, 2023
5925400
Fix unintentional UB in ui tests
saethlin Feb 12, 2023
09797a4
Typo.
cjgillot Feb 13, 2023
3180f1c
Fix #107998, avoid ICE when the generic_span is empty
chenyukang Feb 13, 2023
826abcc
Shrink size of array benchmarks
JulianKnodt Feb 14, 2023
765f703
Rollup merge of #103478 - SpanishPear:spanishpear/issue_103366_fix, r…
Dylan-DPC Feb 14, 2023
86368ae
Rollup merge of #105300 - aliemjay:member-lower, r=oli-obk
Dylan-DPC Feb 14, 2023
6f88493
Rollup merge of #106372 - joboet:solid_id_parking, r=m-ou-se
Dylan-DPC Feb 14, 2023
6bfabbe
Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8Ki
Dylan-DPC Feb 14, 2023
1756653
Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obk
Dylan-DPC Feb 14, 2023
81e6e3a
Rollup merge of #107972 - saethlin:fix-test-ub, r=michaelwoerister
Dylan-DPC Feb 14, 2023
d34957d
Rollup merge of #108003 - chenyukang:yukang/fix-107998, r=compiler-er…
Dylan-DPC Feb 14, 2023
b8d1547
Rollup merge of #108023 - JulianKnodt:smaller_benchmark, r=workingjub…
Dylan-DPC Feb 14, 2023
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
Prev Previous commit
Next Next commit
Complete for_each_aliasing_place.
  • Loading branch information
cjgillot committed Feb 6, 2023
commit 67a8c16fe285dc5dc3ca8a0c74fb1bcfa58ce8dc
8 changes: 8 additions & 0 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,14 @@ impl<'tcx> PlaceRef<'tcx> {
}
}

/// Returns `true` if this `Place` contains a `Deref` projection.
///
/// If `Place::is_indirect` returns false, the caller knows that the `Place` refers to the
/// same region of memory as its base.
pub fn is_indirect(&self) -> bool {
self.projection.iter().any(|elem| elem.is_indirect())
}

/// If MirPhase >= Derefered and if projection contains Deref,
/// It's guaranteed to be in the first place
pub fn has_deref(&self) -> bool {
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_mir_dataflow/src/value_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,10 @@ impl Map {
tail_elem: Option<TrackElem>,
f: &mut impl FnMut(PlaceIndex),
) {
if place.is_indirect() {
// We do not track indirect places.
return;
}
let Some(&Some(mut index)) = self.locals.get(place.local) else {
// The local is not tracked at all, so it does not alias anything.
return;
Expand All @@ -790,6 +794,9 @@ impl Map {
.map(|&elem| elem.try_into())
.chain(tail_elem.map(Ok).into_iter());
for elem in elems {
// A field aliases the parent place.
f(index);

let Ok(elem) = elem else { return };
let sub = self.apply(index, elem);
if let TrackElem::Variant(..) | TrackElem::Discriminant = elem {
Expand Down