-
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
"DefId isn't local" ICE #81839
Comments
This looks like an incremental compilation ICE. Does it disappear after running |
I can't reproduce the ICE, so it does look like an incremental bug |
It does. I have cloned that repo, modified the file as in the git diff above and run |
|
Sorry I had misread.
No, it does not. Sorry for the confusion |
Thanks for the report! I can reproduce with: git clone https://github.com/teloxide/teloxide
cd teloxide/
git checkout fe6429c2790502ae09b04d2659f33e4495f6d314
cargo build --manifest-path examples/sqlite_remember_bot/Cargo.toml
git apply - <<EOF
diff --git a/examples/sqlite_remember_bot/src/transitions.rs b/examples/sqlite_remember_bot/src/transitions.rs
index dcc78db..c8f1777 100644
--- a/examples/sqlite_remember_bot/src/transitions.rs
+++ b/examples/sqlite_remember_bot/src/transitions.rs
@@ -21,6 +21,15 @@ async fn have_number(
ans: String,
) -> TransitionOut<Dialogue> {
let num = state.number;
+ match ans {
+ "abc" => {
+ match num {
+ 1 => { cx.answer_str("hi"); }
+ _ => cx.answer_str("hi")
+ }
+ }
+ _ => ()
+ };
if ans.starts_with("/get") {
cx.answer_str(format!("Here is your number: {}", num)).await?;
EOF
cargo build --manifest-path examples/sqlite_remember_bot/Cargo.toml |
This is caused by: rust/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs Lines 1081 to 1082 in b81f581
There is no guarantee that either |
I've never committed to this repository; if you want to guide me to fix this issue, I'm happy to do it. If it's better if you do it, no worries |
Assigning |
@rustbot claim |
Fix panic in 'remove semicolon' when types are not local It's not possible to check if removing a semicolon fixes the type error when checking match arms and one or both of the last arm's and the current arm's return types are imported "opaque" types. In these cases we don't generate a "consider removing semicolon" suggestions. Fixes rust-lang#81839 --- I'm not sure how to add a test for this. I think the test would need at least two crates. Do we have any existing tests that do this so that I can take a look?
Fix panic in 'remove semicolon' when types are not local It's not possible to check if removing a semicolon fixes the type error when checking match arms and one or both of the last arm's and the current arm's return types are imported "opaque" types. In these cases we don't generate a "consider removing semicolon" suggestions. Fixes rust-lang#81839 --- I'm not sure how to add a test for this. I think the test would need at least two crates. Do we have any existing tests that do this so that I can take a look?
Fix panic in 'remove semicolon' when types are not local It's not possible to check if removing a semicolon fixes the type error when checking match arms and one or both of the last arm's and the current arm's return types are imported "opaque" types. In these cases we don't generate a "consider removing semicolon" suggestions. Fixes rust-lang#81839 --- I'm not sure how to add a test for this. I think the test would need at least two crates. Do we have any existing tests that do this so that I can take a look?
Code
The code is based on this example and the following
git diff
: https://github.com/teloxide/teloxide/tree/dev/examples/sqlite_remember_bot (commit fe6429c2790502ae09b04d2659f33e4495f6d314)Meta
It fails on stable and nightly:
rustc --version --verbose
:$ rustc --version --verbose
rustc 1.49.0 (e1884a8 2020-12-29)
binary: rustc
commit-hash: e1884a8
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0
and
rustc 1.51.0-nightly (04caa63 2021-01-30)
binary: rustc
commit-hash: 04caa63
commit-date: 2021-01-30
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1
Error output
From stable, non verbose:
Backtrace
The text was updated successfully, but these errors were encountered: