Skip to content

ICE: obligations.is_empty() #121649

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Feb 26, 2024 · 7 comments · Fixed by #122942
Closed

ICE: obligations.is_empty() #121649

matthiaskrgr opened this issue Feb 26, 2024 · 7 comments · Fixed by #122942
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait ToUnit<'a> {
    type Unit;
}

trait Overlap<T> {}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}

original:

trait ToUnit<'a> {
    type Unit;
}

impl<Tail, const KEY_ID: &'static str, const K: &'static str> ToUnit<'a> for *const T {}

trait Overlap<T> {}

type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}

Version information

rustc 1.78.0-nightly (b79db437d 2024-02-26)
binary: rustc
commit-hash: b79db437dccd496948bb1819d36ed51598563a98
commit-date: 2024-02-26
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Znext-solver=coherence

Program output

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.w73y8WqrEt1S/rustc_testrunner_tmpdir_reporting.zzKnocpp6us9/mvce.rs:11:59
   |
11 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   |                                                           ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.w73y8WqrEt1S/rustc_testrunner_tmpdir_reporting.zzKnocpp6us9/mvce.rs`

WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ mvce[0033]::{impl#1}::'a), 'a) })], def_id: DefId(0:5 ~ mvce[0033]::ToUnit::Unit) }
thread 'rustc' panicked at compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs:325:13:
assertion failed: obligations.is_empty()
stack backtrace:
   0:     0x7fd9c498ca06 - std::backtrace_rs::backtrace::libunwind::trace::h7b190557205b1228
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7fd9c498ca06 - std::backtrace_rs::backtrace::trace_unsynchronized::ha6bc38fea97fe887
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd9c498ca06 - std::sys_common::backtrace::_print_fmt::h341f97409970e15a
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7fd9c498ca06 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h657f49f3d1c99d4e
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd9c49dd98c - core::fmt::rt::Argument::fmt::h9b0eb269b915782f
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/core/src/fmt/rt.rs:142:9
   5:     0x7fd9c49dd98c - core::fmt::write::hef4379a992fe4484
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/core/src/fmt/mod.rs:1120:17
   6:     0x7fd9c49813cf - std::io::Write::write_fmt::h7e33dbf3b1ed000d
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/io/mod.rs:1846:15
   7:     0x7fd9c498c7b4 - std::sys_common::backtrace::_print::h804cc658c60efb10
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fd9c498c7b4 - std::sys_common::backtrace::print::hd0e6d24a9a3ec77a
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fd9c498f4fb - std::panicking::default_hook::{{closure}}::ha6e94f6d57cd41e6
  10:     0x7fd9c498f249 - std::panicking::default_hook::h1888ac974370e810
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/panicking.rs:292:9
  11:     0x7fd9c78a5f1c - std[20bc6fac038bdf8e]::panicking::update_hook::<alloc[d78268eff55bae8d]::boxed::Box<rustc_driver_impl[de70491f6558020b]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7fd9c498fc60 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h28ec70f07c106b4c
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/alloc/src/boxed.rs:2030:9
  13:     0x7fd9c498fc60 - std::panicking::rust_panic_with_hook::h8ec99ac316e2ffcc
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/panicking.rs:783:13
  14:     0x7fd9c498f969 - std::panicking::begin_panic_handler::{{closure}}::hf8c6fa70a51e025e
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/panicking.rs:649:13
  15:     0x7fd9c498cee6 - std::sys_common::backtrace::__rust_end_short_backtrace::hde0c258637183d4d
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7fd9c498f6d4 - rust_begin_unwind
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/panicking.rs:645:5
  17:     0x7fd9c49d9ea5 - core::panicking::panic_fmt::h62a99383eeecb2b1
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/core/src/panicking.rs:72:14
  18:     0x7fd9c49d9f63 - core::panicking::panic::hbd9c786d92b9fc84
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/core/src/panicking.rs:144:5
  19:     0x7fd9c838d72b - <rustc_trait_selection[d07648c186cf7da6]::solve::eval_ctxt::EvalCtxt>::unify_query_var_values
  20:     0x7fd9c836fde9 - <rustc_trait_selection[d07648c186cf7da6]::traits::coherence::AmbiguityCausesVisitor as rustc_trait_selection[d07648c186cf7da6]::solve::inspect::analyse::ProofTreeVisitor>::visit_goal
  21:     0x7fd9c90b09df - rustc_trait_selection[d07648c186cf7da6]::traits::coherence::overlap
  22:     0x7fd9c964d369 - <rustc_middle[672f916162da190d]::traits::specialization_graph::Children as rustc_trait_selection[d07648c186cf7da6]::traits::specialize::specialization_graph::ChildrenExt>::insert
  23:     0x7fd9c964c23d - <rustc_middle[672f916162da190d]::traits::specialization_graph::Graph as rustc_trait_selection[d07648c186cf7da6]::traits::specialize::specialization_graph::GraphExt>::insert
  24:     0x7fd9c964f576 - rustc_trait_selection[d07648c186cf7da6]::traits::specialize::specialization_graph_provider
  25:     0x7fd9c964f00d - rustc_query_impl[43cff2b1472d6b64]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[43cff2b1472d6b64]::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 8usize]>>
  26:     0x7fd9c8c8c320 - rustc_query_system[825c829a5a5ee210]::query::plumbing::try_execute_query::<rustc_query_impl[43cff2b1472d6b64]::DynamicConfig<rustc_query_system[825c829a5a5ee210]::query::caches::DefIdCache<rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[43cff2b1472d6b64]::plumbing::QueryCtxt, false>
  27:     0x7fd9c9222774 - rustc_query_impl[43cff2b1472d6b64]::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
  28:     0x7fd9c9222c8a - rustc_hir_analysis[48e334b2e707fc63]::coherence::coherent_trait
  29:     0x7fd9c9222a49 - rustc_query_impl[43cff2b1472d6b64]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[43cff2b1472d6b64]::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 1usize]>>
  30:     0x7fd9c8cc77d6 - rustc_query_system[825c829a5a5ee210]::query::plumbing::try_execute_query::<rustc_query_impl[43cff2b1472d6b64]::DynamicConfig<rustc_query_system[825c829a5a5ee210]::query::caches::DefIdCache<rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[43cff2b1472d6b64]::plumbing::QueryCtxt, false>
  31:     0x7fd9c92f5025 - rustc_query_impl[43cff2b1472d6b64]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7fd9c94e4b7a - rustc_hir_analysis[48e334b2e707fc63]::check_crate
  33:     0x7fd9c98010ef - rustc_interface[e4e5f0991526f151]::passes::analysis
  34:     0x7fd9c9800d59 - rustc_query_impl[43cff2b1472d6b64]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[43cff2b1472d6b64]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 1usize]>>
  35:     0x7fd9c9932ba5 - rustc_query_system[825c829a5a5ee210]::query::plumbing::try_execute_query::<rustc_query_impl[43cff2b1472d6b64]::DynamicConfig<rustc_query_system[825c829a5a5ee210]::query::caches::SingleCache<rustc_middle[672f916162da190d]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[43cff2b1472d6b64]::plumbing::QueryCtxt, false>
  36:     0x7fd9c9932909 - rustc_query_impl[43cff2b1472d6b64]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7fd9c993a496 - rustc_interface[e4e5f0991526f151]::interface::run_compiler::<core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>, rustc_driver_impl[de70491f6558020b]::run_compiler::{closure#0}>::{closure#0}
  38:     0x7fd9c9be6045 - std[20bc6fac038bdf8e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e4e5f0991526f151]::util::run_in_thread_with_globals<rustc_interface[e4e5f0991526f151]::util::run_in_thread_pool_with_globals<rustc_interface[e4e5f0991526f151]::interface::run_compiler<core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>, rustc_driver_impl[de70491f6558020b]::run_compiler::{closure#0}>::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>
  39:     0x7fd9c9be5e72 - <<std[20bc6fac038bdf8e]::thread::Builder>::spawn_unchecked_<rustc_interface[e4e5f0991526f151]::util::run_in_thread_with_globals<rustc_interface[e4e5f0991526f151]::util::run_in_thread_pool_with_globals<rustc_interface[e4e5f0991526f151]::interface::run_compiler<core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>, rustc_driver_impl[de70491f6558020b]::run_compiler::{closure#0}>::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[582474e281ef7080]::result::Result<(), rustc_span[d964d3092beb82ea]::ErrorGuaranteed>>::{closure#1} as core[582474e281ef7080]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  40:     0x7fd9c4999635 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb7065bf16da10381
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/alloc/src/boxed.rs:2016:9
  41:     0x7fd9c4999635 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3918eebecb806807
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/alloc/src/boxed.rs:2016:9
  42:     0x7fd9c4999635 - std::sys::pal::unix::thread::Thread::new::thread_start::h9785a57a6fc9c198
                               at /rustc/b79db437dccd496948bb1819d36ed51598563a98/library/std/src/sys/pal/unix/thread.rs:108:17
  43:     0x7fd9c474b55a - <unknown>
  44:     0x7fd9c47c8a3c - <unknown>
  45:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.78.0-nightly (b79db437d 2024-02-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z next-solver=coherence -Z dump-mir-dir=dir

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `Overlap`
#1 [coherent_trait] coherence checking all impls of trait `Overlap`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0601`.

@matthiaskrgr matthiaskrgr 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. C-bug Category: This is a bug. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2024
@matthiaskrgr
Copy link
Member Author

#119106 cc @lcnr

@compiler-errors
Copy link
Member

Probably due to the fact that higher_ranked_sub doesn't preserve the StructurallyRelateAliases::Yes flag.

@jieyouxu jieyouxu added S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 28, 2024
@lcnr
Copy link
Contributor

lcnr commented Feb 29, 2024

should be fixed by #118247

@spastorino
Copy link
Member

With #118247 the output is ...

gh-spastorino@dev-desktop-us-1:~$ rustc +rust1-stage1 test.rs
error[E0601]: `main` function not found in crate `test`
  --> test.rs:11:59
   |
11 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   |                                                           ^ consider adding a `main` function to `test.rs`

error[E0277]: the trait bound `for<'a> *const T: ToUnit<'a>` is not satisfied
  --> test.rs:11:36
   |
11 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   |                                    ^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `*const T`
   |
help: this trait has no implementations, consider adding one
  --> test.rs:1:1
   |
1  | trait ToUnit<'a> {
   | ^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `for<'a> *const T: ToUnit<'a>` is not satisfied
  --> test.rs:11:55
   |
11 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   |                                                       ^ the trait `for<'a> ToUnit<'a>` is not implemented for `*const T`, which is required by `T: Overlap<for<'a> fn(&'a (), _)>`
   |
help: this trait has no implementations, consider adding one
  --> test.rs:1:1
   |
1  | trait ToUnit<'a> {
   | ^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `for<'a> *const T: ToUnit<'a>` is not satisfied
  --> test.rs:11:17
   |
11 | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `*const T`
   |
help: this trait has no implementations, consider adding one
  --> test.rs:1:1
   |
1  | trait ToUnit<'a> {
   | ^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.

@lcnr
Copy link
Contributor

lcnr commented Mar 1, 2024

should add the following as a test

trait ToUnit<'a> {
    type Unit;
}

trait Overlap<T> {}

type Assoc<'a, T> = <T as ToUnit<'a>>::Unit;

impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}

fn main() {}

@lcnr lcnr added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Mar 4, 2024
@compiler-errors compiler-errors added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Mar 22, 2024
@Luv-Ray
Copy link
Contributor

Luv-Ray commented Mar 23, 2024

Hello, I'm a beginner and I would like to contribute to Rust. Since this issue has been marked as "Easy," what is the desired behavior of this program and how can I approach it? Any help would be appreciated.

@compiler-errors
Copy link
Member

@Luv-Ray: This is marked E-needs-test, so the only change here would be to add this test to the test suite, since the issue has been fixed.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 23, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 23, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 24, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 24, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 24, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 24, 2024
Rollup merge of rust-lang#122942 - Luv-Ray:master, r=lcnr

Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
RenjiSann pushed a commit to RenjiSann/rust that referenced this issue Mar 25, 2024
Add test in higher ranked subtype

I'm a beginner in this repository, and there are some things I'm not sure about:

- Is it okay that there is a warning:
```
rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit) }
```
- Is it okay that there are two duplicate errors in the same line?
- Did I put the test in the right place?

Any suggestions would be appreciated.

Fixes rust-lang#121649
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. 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) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants