Change:
I get an ICE when I try to build : I tried stable, beta and nightly. All ended with an ICE.
Important detail: Only happens on the branch, not
(bisecting)
It happens with master branch as well if I do before building. Without it, it fails due to nalgebra issue before it even gets to evolvim-lib.
Ah, I see
regression in nightly-2019-08-17
great :). Unsure if you're bisecting this further, anyway pinging cleanup crew in case you are not doing it further and also to see if someone is able to get an mcve. ping cleanup
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good "Cleanup ICE-breaking candidate". In case it's useful, here are some [instructions] for tackling these sorts of bugs. Maybe take a look? Thanks! <3 [instructions]: https://rustc-dev- cc
There don't seem to be any prebuilt artifacts for that commit range, so I've stopped there.
Assigning meanwhile we don't have an mcve as .
() Errors: modify labels to -E-needs-mcve
The reduced example regresses at nightly-2019-09-29 (..). Edit2: For me, evolvim (develop branch) regresses on that nightly, too. <br<br<details<summary<del<ttgit log</tt<iafter bisection</i</del</summary</detailsEdit3: Damn it, recompiling didn’t make realize that the code had to be recompiled and I didn’t really notice that it had just skipped compilation entirely all the time.
Even smaller: () Errors: <details</details
regression in commit (part of ) cc modify labels: -E-needs-bisection
Error: Label ICEBreaker-Cleanup-Crew can only be set by Rust team members Please let know if you're having trouble with this bot.
Error: Label ICEBreaker-Cleanup-Crew can only be set by Rust team members Please let know if you're having trouble with this bot.
Now that we have an -- thanks -- let's prioritize again
prioritize -- just testing the command
Error: This issue has already been requested for prioritization. Please let know if you're having trouble with this bot.
prioritize -- just testing the command
Looks like this compiles but it shouldn't: Dumping the MIR for this you get: Presumably, what should happen here is: The occurs here: cc
This issue is already prioritized as removing label.
I guess we need to track down where [S; 1] is emitted and make that code also look at the MIR of promoteds. We can't avoid that code from getting promoted without getting into an unfun game of whack-a-mole in the promotion code.
The error is constructed here: which is called here: and here:
hmmm... not sure what borrowck does to promoteds. I mean we basically declared all lifetimes to be static, but the same is true for the body of constants which we do run borrowck on. So... let's try to just run borrowck on promoteds and see how it goes.
alternatively we just run the logic on promoteds instead of full borrowck, as the latter may have a significant perf impact.

Discussion:
let location_table = &LocationTable::new(&body); let mut errors_buffer = Vec::new(); <del> let (move_data, move_errors): (MoveData<'tcx>, Option<Vec<(Place<'tcx>, MoveError<'tcx>)>>) = </del> <ins> let (move_data, move_errors): (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>) = </ins> match MoveData::gather_moves(&body, tcx, param_env) { <del> Ok(move_data) => (move_data, None), Err((move_data, move_errors)) => (move_data, Some(move_errors)), </del> <ins> Ok(move_data) => (move_data, Vec::new()), Err((move_data, move_errors)) => (move_data, move_errors), </ins> }; <ins> let promoted_errors = promoted .iter_enumerated() .map(|(idx, body)| (idx, MoveData::gather_moves(&body, tcx, param_env))); </ins> let mdpe = MoveDataParamEnv { move_data, param_env };

_ => true, }; <ins> for (idx, move_data_results) in promoted_errors { let promoted_body = &promoted[idx]; let dominators = promoted_body.dominators(); if let Err((move_data, move_errors)) = move_data_results { let mut promoted_mbcx = MirBorrowckCtxt { infcx, body: promoted_body, mir_def_id: def_id.to_def_id(), move_data: &move_data, location_table: &LocationTable::new(promoted_body), movable_generator, locals_are_invalidated_at_exit, access_place_error_reported: Default::default(), reservation_error_reported: Default::default(), reservation_warnings: Default::default(), move_error_reported: BTreeMap::new(), uninitialized_error_reported: Default::default(), errors_buffer, regioncx: regioncx.clone(), used_mut: Default::default(), used_mut_upvars: SmallVec::new(), borrow_set: borrow_set.clone(), dominators, upvars: Vec::new(), local_names: IndexVec::from_elem(None, &promoted_body.local_decls), region_names: RefCell::default(), next_region_name: RefCell::new(1), polonius_output: None, }; promoted_mbcx.report_move_errors(move_errors); errors_buffer = promoted_mbcx.errors_buffer; }; } </ins> let dominators = body.dominators(); let mut mbcx = MirBorrowckCtxt {

borrows: flow_borrows, }; <del> if let Some(errors) = move_errors { mbcx.report_move_errors(errors); } </del> <ins> mbcx.report_move_errors(move_errors); </ins> dataflow::visit_results( &body,

<ins> // Regression test for #70934 struct S; fn foo() { &([S][0],); //~^ ERROR cannot move out of type `[S; 1]` } fn main() {} </ins>

<ins> error[E0508]: cannot move out of type `[S; 1]`, a non-copy array --> $DIR/move-error-in-promoted-2.rs:6:7 | LL |     &([S][0],); |       ^^^^^^ |       | |       cannot move out of here |       move occurs because value has type `S`, which does not implement the `Copy` trait error: aborting due to previous error For more information about this error, try `rustc --explain E0508`. </ins>

<ins> // Regression test for #70934 fn f() { const C: [S2; 1] = [S2]; let _ = S1(C[0]).clone(); //~^ ERROR cannot move out of type `[S2; 1]` } #[derive(Clone)] struct S1(S2); #[derive(Clone)] struct S2; fn main() { f(); } </ins>

<ins> error[E0508]: cannot move out of type `[S2; 1]`, a non-copy array --> $DIR/move-error-in-promoted.rs:5:16 | LL |     let _ = S1(C[0]).clone(); |                ^^^^ |                | |                cannot move out of here |                move occurs because value has type `S2`, which does not implement the `Copy` trait error: aborting due to previous error For more information about this error, try `rustc --explain E0508`. </ins>