-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
deref_target_place is not a deref projection #105881
Comments
@rustbot label +regression-from-stable-to-nightly |
Revert rust-lang#103880 "Use non-ascribed type as field's type in mir" This PR prepares a revert for rust-lang#103880 to fix rust-lang#105809, rust-lang#105881, rust-lang#105886 and others (like the duplicates of the first one), in case an actual fix can't get done today. I've also added the MCVE from rust-lang#105809. There is no MCVE for the rust-lang#105881 and rust-lang#105886 ICEs yet however, so there are no tests for them here, although we'll need one before relanding the original changes. Were this PR to land, it would also reopen rust-lang#96514 as it was fixed by the original PR. Opening as draft to allow time for a possible fix. r? `@jackh726`
This should be fixed in tomorrow's nightly now that #105905 has been merged. It would be great to even have the |
not sure whether I'll manage to get ride of all of it, but I'll give it a try |
I am working on reducing the issue, should I make a PR with the non-regression test, or do I simply post it here ? |
Either is fine, but if you know how to make a UI test ensuring the regression happens without the revert, it'll be easier to land of course. Whatever is easiest for you, and I'll take care of the rest. |
Here is the standalone code: use std::{
future::{poll_fn, Future},
pin::Pin,
task::{Context, Poll},
};
pub struct SelectAll<Fut> {
inner: Vec<Fut>,
}
pub struct Fuse<Fut> {
inner: Option<Fut>,
}
impl<Fut: Future + Unpin> Future for SelectAll<Fut> {
type Output = (Fut::Output, usize, Vec<Fut>);
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
loop {}
}
}
async fn next_message() {
todo!()
}
impl<Fut: Future> Future for Fuse<Fut> {
type Output = Fut::Output;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Fut::Output> {
loop {}
}
}
async fn run_one_step() {
let mut all_next_messages = vec![Box::pin(next_message())];
{
{
enum __PrivResult<_0> {
_0(_0),
}
let __select_result = {
let mut _0 = {
let this = {
let iter = all_next_messages.iter_mut();
let ret = SelectAll {
inner: iter.into_iter().collect(),
};
ret
};
Fuse { inner: Some(this) }
};
let mut __poll_fn = |__cx: &mut core::task::Context<'_>| {
let mut _0 = |__cx: &mut core::task::Context<'_>| {
let mut _0 = unsafe { core::pin::Pin::new_unchecked(&mut _0) };
if true {
None
} else {
Some(_0.poll(__cx).map(__PrivResult::_0))
}
};
let mut __select_arr = [&mut _0];
for poller in &mut __select_arr {
match poller(__cx) {
Some(x @ core::task::Poll::Ready(_)) => return x,
Some(core::task::Poll::Pending) => {}
None => {}
}
}
core::task::Poll::Pending
};
poll_fn(__poll_fn).await
};
match __select_result {
__PrivResult::_0(_) => {
let _ = all_next_messages;
}
}
}
}
} I do have not minimized it to the full extent, but it is standalone now. |
best I got is use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
async fn new_future() {
loop {}
}
pub struct SelectAll<Fut> {
_inner: Fut,
}
fn select_all<I>(_: I) -> SelectAll<I::Item>
where
I: IntoIterator,
I::Item: Future + Unpin,
{
loop {}
}
impl<Fut: Future> Future for SelectAll<Fut> {
type Output = ();
fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> {
loop {}
}
}
async fn run_one_step() {
let mut select = select_all(vec![Box::pin(new_future())]);
let poll_fns = &mut |cx: &mut Context<'_>| Pin::new(&mut select).poll(cx);
for _poll_fn in [poll_fns] {}
} I'll make a PR later today if no one makes one before (feel free to make one if you want) |
This is what you should put as the test: it is your code, modified to make a UI test. I would put it in // check-fail
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
pub struct SelectAll<Fut> {
_inner: Fut,
}
impl<Fut: Future> Future for SelectAll<Fut> {
type Output = ();
fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> {
loop {}
}
}
async fn new_future() {
loop {}
}
fn select_all<I>(_: I) -> SelectAll<I::Item>
where
I: IntoIterator,
I::Item: Future + Unpin,
{
loop {}
}
async fn run_one_step() {
let mut select = select_all(vec![Box::pin(new_future())]);
let mut poll_fn = |cx: &mut Context<'_>| Pin::new(&mut select).poll(cx);
for _poll_fn in [&mut poll_fn] {}
}
fn main() {} |
@trinity-1686a I have a fix ready for the original PR that was reverted and caused this issue and will use your mcve as a test. Thanks for minimizing this issue. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
This is fixed by #105905, isn't it? |
I think so. I'll go ahead and close this issue |
Code
Meta
rustc --version --verbose
:Error output
Backtrace
Additional information
I can't reproduce with
rustc 1.68.0-nightly (ec56537c4 2022-12-15)
, but I can withrustc 1.68.0-nightly (9c07efe84 2022-12-16)
. It seems to be a recent regressionThe text was updated successfully, but these errors were encountered: