-
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
'index out of bounds: the len is 1 but the index is 1': libcore/slice/mod.rs #68801
Comments
Could you provide reproducible example? |
Or at least please run with |
Here's a full backtrace:
Hope it helps :) |
Uhm, I guess it's a rustc ICE probably, does it also happen when you run |
```
cargo clippy
```
|
@harrisonthorne you might not realize it because it was sent via email, but your last comment is empty |
Oops, I misread @JohnTitor 's comment. It happens with |
Thanks! So it's not a Clippy ICE but a rustc ICE. |
What |
I got a similar panic with rustc 1.43.0-nightly (58b8343 2020-02-05)
|
@threecgreen that is great that you can reproduce this bug. Can you provide a code sample for the reproduction, or a link to the source code for your crate where you are seeing it? |
triage: I don't want to assign a priority to this without more information. leaving nominated to ensure I come back to it. |
I was not able to easily create a small code sample, but this was the state of my code when I saw the panic. |
I just caused a lot of these to appear in the async/await tests when changing the HIR lowering of async/await. I've pushed that state as https://github.com/jonas-schievink/rust/commit/1197e62c8573e72c41231dc65d58c9a0efc13ecb. I probably did something wrong in the HIR building code, but a similar issue might be preexisting, which could cause this I guess. |
@rustbot ping icebreakers-cleanup-crew Dear cleanup crew, it would be great to try and narrow this down to a self-contained example. @threecgreen has a crate here that reproduces the problem, but it's not a small, workable example. |
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good cc @AminArria @chrissimpkins @DutchGhost @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @matheus-consoli @mental32 @Noah-Kennedy @pard68 @pierreN @robjtede @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke |
Also would be good to know if this is a regression. |
Tagging as P-high for now because the ICE gives so little actionable information to guide the user as to how to correct the problem. |
@harrisonthorne Can you run cargo bisect on this so we can identify if this is a regression in rustc. |
Source: crash-demo branch of https://github.com/threecgreen/vinoteca/tree/crash-demo There are multiple ICE error types coming from this source: pub fn top<Table: diesel::Table + diesel::query_dsl::InternalJoinDsl<_, diesel::query_source::joins::Inner, _>>(table: Table, limit: usize, connection: DbConn) -> RestResult<Vec<TopWineType>> {
table
.inner_join(wines::table.inner_join(purchases::table))
.group_by((producers::id, producers::name))
.select((
wines::id,
wines::name,
sql::<Integer>("sum(purchases.quantity)"),
// Should probably be distinct
sql::<Integer>("count(wines.id)"),
sql::<Float>("avg(purchases.price)"),
))
.order_by(sql::<Integer>("sum(purchases.quantity) DESC"))
.limit(limit as i64)
.load::<TopWineType>(&*connection)
.map(Json)
.map_err(VinotecaError::from)
} ICE's:
then this panic:
|
Regression in the vinoteca source. edit: Not the same ICE that was reported in the OP Tested with builds of the full crate searched nightlies: from nightly-2019-08-01 to nightly-2020-02-01 Errors before the regression:
Reproduce rustc bisect report:
|
@estebank Esteban, I'm not sure if this is the same ICE that was reported in the OP. The source that I used was from #68801 (comment) based on the request in #68801 (comment). I'm not seeing a |
@chrissimpkins by fixing that underlying bad gating of
|
I have a repro for the first panic, not for the panic while panicking yet: extern crate diesel;
pub fn top<Table: diesel::Table +
diesel::query_dsl::InternalJoinDsl<
_, diesel::query_source::joins::Inner, _
>>(
table: Table
) {}
|
Ok, I think this is as small as I can make all 8 errors: code#[macro_use]
extern crate diesel;
mod schema {
table! {
producers (id) {
id -> Integer,
}
}
table! {
purchases (id) {
id -> Integer,
wine_id -> Integer,
}
}
table! {
wines (id) {
id -> Integer,
producer_id -> Integer,
}
}
joinable!(purchases -> wines (wine_id));
allow_tables_to_appear_in_same_query!(
producers,
purchases,
wines,
);
}
mod model {
use crate::schema::{purchases, wines};
use diesel::prelude::*;
pub fn top<Table: diesel::Table +
diesel::query_dsl::InternalJoinDsl<
_, diesel::query_source::joins::Inner, _
>>(
table: Table
) {
table.inner_join(wines::table.inner_join(purchases::table))
}
} errors
|
@hellow554 I'm 99% sure it will. |
Account for bounds and asociated items when denying `_` Fix rust-lang#68801, rust-lang#69204. Follow up to rust-lang#67597 and rust-lang#68071. Output for the original ICE report: ``` Checking vinoteca v5.0.0 (/Users/ekuber/workspace/vinoteca) error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> src/producers.rs:43:70 | 43 | pub fn top<Table: diesel::Table + diesel::query_dsl::InternalJoinDsl<_, diesel::query_source::joins::Inner, _>>(table: Table, limit: usize, connection: DbConn) -> RestResult<Vec<TopWineType>> { | ^ not allowed in type signatures ^ not allowed in type signatures error: aborting due to previous error ```
Edit: Clippy version:
The text was updated successfully, but these errors were encountered: