-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: ICE: synthetic auto trait impls: index out of bounds, snapshot vec
using -Znormalize-docs
#112242
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
Labels
-Znormalize-docs
Unstable rustdoc option: Normalize/evaluate types when generating docs
A-auto-traits
Area: auto traits (e.g., `auto trait Send {}`)
A-synthetic-impls
Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket impls
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Comments
reduced a bit mod foo {
pub trait MyTrait<'a> {
type MyItem: ?Sized;
}
pub struct Inner<'a, Q, R: ?Sized> {
field: Q,
field3: &'a u8,
my_foo: Foo<Q>,
field2: R,
}
pub struct Outer<'a, T, K: ?Sized> {
my_inner: Inner<'a, T, K>,
}
pub struct Foo<T> {
myfield: T,
}
}
pub use foo::{Foo, Inner as NotInner, MyTrait as NotMyTrait};
unsafe impl<'a, Q, R: ?Sized> Send for NotInner<'static, Q, R>
where
Q: NotMyTrait<'a>,
<Q as NotMyTrait<'a>>::MyItem: Copy,
R:,
Foo<Q>: Send,
{
} |
Ah another |
reduce:
trait MyTrait<'a> {
type MyItem;
}
struct Inner<Q>(Q);
struct Outer<Q>(Inner<Q>);
unsafe impl<'a, Q> Send for Inner<Q>
where
Q: MyTrait<'a>,
<Q as MyTrait<'a>>::MyItem: Copy,
{} |
All three reproducers will be fixed by #108503. |
// check-pass
// Another minimized regression test for #112832.
trait Trait {
type Assoc;
}
trait Sub<'a>: Trait<Assoc = <Self as Sub<'a>>::SubAssoc> {
type SubAssoc;
}
// By using the where-clause we normalize `<T as Trait>::Assoc` to
// `<T as Sub<'a>>::SubAssoc` where `'a` is an unconstrained region
// variable.
fn foo<T>(x: <T as Trait>::Assoc)
where
for<'a> T: Sub<'a>,
{}
fn main() {} |
I can no longer reproduce any of these issues. |
index out of bounds, snapshot vec
using -Znormalize-docs
index out of bounds, snapshot vec
using -Znormalize-docs
index out of bounds, snapshot vec
using -Znormalize-docs
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 2, 2024
…sts, r=GuillaumeGomez rustdoc: add a couple of regression tests Fixes rust-lang#114657. Fixes rust-lang#112828. Fixes rust-lang#112242. Fixes rust-lang#107715. r? rustdoc
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 2, 2024
…uillaumeGomez rustdoc: synthetic auto trait impls: accept unresolved region vars for now rust-lang#123348 (comment): > Right, [in rust-lang#123340] I've intentionally changed a `vid_map.get(vid).unwrap_or(r)` to a `vid_map[vid]` making rustdoc panic if `rustc::AutoTraitFinder` returns a region inference variable that cannot be resolved because that is really fishy. I can change it back with a `FIXME: investigate` […]. [O]nce I [fully] understand [the arcane] `rustc::AutoTraitFinder` [I] can fix the underlying issue if there's one. > > `rustc::AutoTraitFinder` can also return placeholder regions `RePlaceholder` which doesn't seem right either and which makes rustdoc ICE, too (we have a GitHub issue for that already[, namely rust-lang#120606]). Fixes rust-lang#123370. Fixes rust-lang#112242. r? `@GuillaumeGomez`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 2, 2024
Rollup merge of rust-lang#123375 - fmease:rustdoc-sati-re-hotfix, r=GuillaumeGomez rustdoc: synthetic auto trait impls: accept unresolved region vars for now rust-lang#123348 (comment): > Right, [in rust-lang#123340] I've intentionally changed a `vid_map.get(vid).unwrap_or(r)` to a `vid_map[vid]` making rustdoc panic if `rustc::AutoTraitFinder` returns a region inference variable that cannot be resolved because that is really fishy. I can change it back with a `FIXME: investigate` […]. [O]nce I [fully] understand [the arcane] `rustc::AutoTraitFinder` [I] can fix the underlying issue if there's one. > > `rustc::AutoTraitFinder` can also return placeholder regions `RePlaceholder` which doesn't seem right either and which makes rustdoc ICE, too (we have a GitHub issue for that already[, namely rust-lang#120606]). Fixes rust-lang#123370. Fixes rust-lang#112242. r? ``@GuillaumeGomez``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
-Znormalize-docs
Unstable rustdoc option: Normalize/evaluate types when generating docs
A-auto-traits
Area: auto traits (e.g., `auto trait Send {}`)
A-synthetic-impls
Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket impls
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Code
rustdoc -Znormalize-docs --edition=2021 file.rs
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: