-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Broken MIR in async fn generation #73914
Comments
Confirmed this also breaks the same way on |
MCVE: struct S<T>(std::marker::PhantomData<T>);
impl<T> std::ops::Deref for S<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
todo!()
}
}
impl<T> std::ops::DerefMut for S<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
todo!()
}
}
async fn new() -> S<u64> {
todo!()
}
async fn crash() {
*new().await = 1 + 1;
}
fn main() {
let _ = crash();
} Fun fact: changing Also it would be nice to get rid of the deref, but I couldn't figure out how. So it's on this currently. Also worth mentioning: this needs @rustbot modify labels: -E-needs-mcve +E-needs-bisection |
The bisection doesn't emit anything useful. This panics like forever. I went back to 2019-01-01 (with the old Feel free to add the tag again, but I'll remove it. @rustbot modify labels: -E-needs-bisection |
@rustbot modify labels: -E-needs-bisection |
…mp-generator-interior, r=matthewjasper mir: mark mir construction temporaries as internal Fixes rust-lang#73914. This PR marks temporaries from MIR construction as internal such that they are skipped in `sanitize_witness` (where each MIR local is checked to have been contained within the generator interior computed during typeck). This resolves an ICE whereby the construction of checked addition introduced a `(u64, bool)` temporary which was not in the HIR and thus not in the generator interior. r? @matthewjasper
…mp-generator-interior, r=matthewjasper mir: mark mir construction temporaries as internal Fixes rust-lang#73914. This PR marks temporaries from MIR construction as internal such that they are skipped in `sanitize_witness` (where each MIR local is checked to have been contained within the generator interior computed during typeck). This resolves an ICE whereby the construction of checked addition introduced a `(u64, bool)` temporary which was not in the HIR and thus not in the generator interior. r? @matthewjasper
…mp-generator-interior, r=matthewjasper mir: mark mir construction temporaries as internal Fixes rust-lang#73914. This PR marks temporaries from MIR construction as internal such that they are skipped in `sanitize_witness` (where each MIR local is checked to have been contained within the generator interior computed during typeck). This resolves an ICE whereby the construction of checked addition introduced a `(u64, bool)` temporary which was not in the HIR and thus not in the generator interior. r? @matthewjasper
…mp-generator-interior, r=matthewjasper mir: mark mir construction temporaries as internal Fixes rust-lang#73914. This PR marks temporaries from MIR construction as internal such that they are skipped in `sanitize_witness` (where each MIR local is checked to have been contained within the generator interior computed during typeck). This resolves an ICE whereby the construction of checked addition introduced a `(u64, bool)` temporary which was not in the HIR and thus not in the generator interior. r? @matthewjasper
Hey, This code attempts to increment a integer behind a tokio RwLock by 1, This causes a compiler error.
Minimized example that reproduces the ICE:
But, making this very small modification makes the code not break the compiler
my
Cargo.toml
containstokio = {version = "0.2.21", features=["full"] }
as a dependency.This code does not compile, and generates the following error (full backtrace in bottom of the issue)
Meta
rustc --version --verbose
also breaks the same way on
stable
(the traces attached are from nightly ^)rustup run stable rustc --version -v
Backtrace (RUST_BACKTRACE=1)
The text was updated successfully, but these errors were encountered: