Skip to content

Rollup of 7 pull requests #135655

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 23 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fc9a14d
cleanup promoteds move check
lcnr Dec 18, 2024
67f4901
add tidy warning for unrecognized directives
cod10129 Jan 15, 2025
865a09d
remove unnecessary assertion for reference error
chenyukang Jan 17, 2025
5b46a07
Move std::env unit tests to integration tests
bjorn3 Jan 17, 2025
ce2f242
Move std::error unit tests to integration tests
bjorn3 Jan 17, 2025
5d07ee8
ci: improve github action name
marcoieni Jan 17, 2025
21c0d95
Move std float unit tests to integration tests
bjorn3 Jan 17, 2025
a89675d
Move std::num unit tests to integration tests
bjorn3 Jan 17, 2025
fc152a0
Move std::panic unit tests to integration tests
bjorn3 Jan 17, 2025
4d5b0ec
Move std::path unit tests to integration tests
bjorn3 Jan 17, 2025
9b142dd
Move std::time unit tests to integration tests
bjorn3 Jan 17, 2025
c4289e4
Move std::thread_local unit tests to integration tests
bjorn3 Jan 17, 2025
f301e4d
Move std::sync unit tests to integration tests
bjorn3 Jan 17, 2025
d48be0d
Fix benchmarking of libstd
bjorn3 Jan 17, 2025
00844be
new solver: prefer trivial builtin impls over where-clauses
lqd Jan 17, 2025
d58540d
add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_A…
lolbinarycat Jan 17, 2025
39274b6
Rollup merge of #134455 - lcnr:move-errors-in-promoteds, r=compiler-e…
matthiaskrgr Jan 17, 2025
f9c3b8c
Rollup merge of #135421 - cod10129:warn-tidy-ignore, r=onur-ozkan
matthiaskrgr Jan 17, 2025
8ef152e
Rollup merge of #135611 - chenyukang:yukang-fix-135341-ice-crash, r=o…
matthiaskrgr Jan 17, 2025
150c2c0
Rollup merge of #135620 - marcoieni:edit-ghcr-action-name, r=Kobzol
matthiaskrgr Jan 17, 2025
84534e8
Rollup merge of #135621 - bjorn3:move_tests_to_stdtests, r=Noratrieb
matthiaskrgr Jan 17, 2025
03fb232
Rollup merge of #135639 - lqd:trivial-builtin-impls, r=lcnr
matthiaskrgr Jan 17, 2025
10239b1
Rollup merge of #135654 - lolbinarycat:bootstrap-135650, r=onur-ozkan
matthiaskrgr Jan 17, 2025
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
Next Next commit
cleanup promoteds move check
  • Loading branch information
lcnr committed Dec 20, 2024
commit fc9a14d31a5b79bccfbc7d64e64163ddbb8a4a06
18 changes: 9 additions & 9 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ fn do_mir_borrowck<'tcx>(
let location_table = LocationTable::new(body);

let move_data = MoveData::gather_moves(body, tcx, |_| true);
let promoted_move_data = promoted
.iter_enumerated()
.map(|(idx, body)| (idx, MoveData::gather_moves(body, tcx, |_| true)));

let flow_inits = MaybeInitializedPlaces::new(tcx, body, &move_data)
.iterate_to_fixpoint(tcx, body, Some("borrowck"))
Expand Down Expand Up @@ -235,10 +232,14 @@ fn do_mir_borrowck<'tcx>(
false
};

for (idx, move_data) in promoted_move_data {
// While promoteds should mostly be correct by construction, we need to check them for
// invalid moves to detect moving out of arrays:`struct S; fn main() { &([S][0]); }`.
for promoted_body in &promoted {
use rustc_middle::mir::visit::Visitor;

let promoted_body = &promoted[idx];
// This assumes that we won't use some of the fields of the `promoted_mbcx`
// when detecting and reporting move errors. While it would be nice to move
// this check out of `MirBorrowckCtxt`, actually doing so is far from trivial.
let move_data = MoveData::gather_moves(promoted_body, tcx, |_| true);
let mut promoted_mbcx = MirBorrowckCtxt {
infcx: &infcx,
body: promoted_body,
Expand All @@ -262,9 +263,6 @@ fn do_mir_borrowck<'tcx>(
move_errors: Vec::new(),
diags,
};
MoveVisitor { ctxt: &mut promoted_mbcx }.visit_body(promoted_body);
promoted_mbcx.report_move_errors();

struct MoveVisitor<'a, 'b, 'infcx, 'tcx> {
ctxt: &'a mut MirBorrowckCtxt<'b, 'infcx, 'tcx>,
}
Expand All @@ -276,6 +274,8 @@ fn do_mir_borrowck<'tcx>(
}
}
}
MoveVisitor { ctxt: &mut promoted_mbcx }.visit_body(promoted_body);
promoted_mbcx.report_move_errors();
}

let mut mbcx = MirBorrowckCtxt {
Expand Down
Loading