-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Trait's types could not be determined #114057
Labels
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Jenya705
added
C-bug
Category: This is a bug.
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.
labels
Jul 25, 2023
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jul 25, 2023
This one works okay: pub trait A {
type B;
fn m(b: Self::B);
}
pub trait C<'a> {
type D: 'a;
}
struct S;
impl<'a> C<'a> for S {
type D = ();
}
struct T<D: 'static> {
d: &'static D,
}
impl A for S
where
for<'a> S: C<'a> {
type B = T<<S as C<'static>>::D>;
fn m(b: Self::B) {
f(b.d)
}
}
fn f(d: &<S as C>::D) {}
fn main() {} |
This one also (Just proxying a type, that means that something strange with struct's generics): pub trait A {
type B;
fn m(b: Self::B);
}
pub trait C<'a> {
type D: 'a;
}
struct S;
impl<'a> C<'a> for S {
type D = ();
}
struct T1<D: 'static> {
d: &'static D,
}
type T<CG> = T1<<CG as C<'static>>::D>;
impl A for S
where
for<'a> S: C<'a> {
type B = T<S>;
fn m(b: Self::B) {
f(b.d);
}
}
fn f(d: &<S as C>::D) {}
fn main() {} |
saethlin
removed
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jul 25, 2023
This worked fine before 1.70.0 so it's a regression. |
minimized trait Bar<'a> {
type Assoc: 'static;
}
impl<'a> Bar<'a> for () {
type Assoc = ();
}
struct ImplsStatic<CG: Bar<'static>> {
d: &'static <CG as Bar<'static>>::Assoc,
}
fn caller(b: ImplsStatic<()>)
where
for<'a> (): Bar<'a>
{
let _: &<() as Bar<'static>>::Assoc = b.d;
}
fn main() {} |
compiler-errors
added
the
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
label
Oct 3, 2023
apiraino
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Oct 4, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Oct 4, 2023
Remove is global hack In attempt to fix rust-lang#114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed. In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs This is a fix candidate opened for performance run. r? `@lcnr`
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
rustbot
added
P-medium
Medium priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Oct 4, 2023
Once #116417 this will be fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
fixed-by-next-solver
Fixed by the next-generation trait solver, `-Znext-solver`.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: