Skip to content
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

ICE cannot relate bound region: ReLateBound(501, BrAnon(0)) <= ReLateBound(501, BrAnon(0)) #18188

Closed
dterhorst-zz opened this issue Oct 20, 2014 · 0 comments · Fixed by #19780
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@dterhorst-zz
Copy link

RUSTC -V

rustc 0.13.0-nightly (ff61b74a7 2014-10-13 00:22:39 +0000)

OS

Mac OS X 10.8.4
Darwin hexbox 12.4.1 Darwin Kernel Version 12.4.1: Tue May 21 17:04:50 PDT 2013; root:xnu-2050.40.51~1/RELEASE_X86_64 x86_64

CODE

pub trait Promisable: Send + Sync {}
impl<T: Send + Sync> Promisable for T {}

pub fn propagate<T:Promisable + Clone, E:Promisable + Clone>(action:proc(&T) -> Result<T, E>) -> proc(Result<T, E>) -> Result<T, E> {
  proc(result:Result<T, E>) {
    match result {
      Ok(ref t) => action(t),
      Err(ref e) => Err(e.clone()),
    }
  }
}

TRACE

   Compiling promise v0.0.1 (file:///Users/hex/projects/active/promise)
     Running `rustc src/promise.rs --crate-name promise --crate-type lib -g -C metadata=3a86d92f1ae335d6 -C extra-filename=-3a86d92f1ae335d6 --out-dir /Users/hex/projects/active/promise/target --dep-info /Users/hex/projects/active/promise/target/.fingerprint/promise-3a86d92f1ae335d6/dep-lib-promise -L /Users/hex/projects/active/promise/target -L /Users/hex/projects/active/promise/target/deps`
src/promise.rs:114:3: 119:4 error: internal compiler error: cannot relate bound region: ReLateBound(501, BrAnon(0)) <= ReLateBound(501, BrAnon(0))
src/promise.rs:114   proc(result:Result<T, E>) {
src/promise.rs:115     match result {
src/promise.rs:116       Ok(ref t) => action(t),
src/promise.rs:117       Err(ref e) => Err(e.clone()),
src/promise.rs:118     }
src/promise.rs:119   }
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:113

stack backtrace:
   1:        0x10d2cbd59 - rt::backtrace::imp::write::h189e19957ab9c695OLq
   2:        0x10d2cf071 - failure::on_fail::h03dc2437e5a88345n2q
   3:        0x10d53de95 - unwind::begin_unwind_inner::h033484cc1a8bac37Jud
   4:        0x10ca3f727 - unwind::begin_unwind::h10204231053729938248
   5:        0x10ca3f6c0 - unwind::begin_unwind::h10204231053729938248
   6:        0x10a02c13d - driver::session::Session::span_bug::h2d1d0d9bc4580ef6n9x
   7:        0x10a4d3539 - middle::typeck::infer::region_inference::RegionVarBindings<'a, 'tcx>::make_subregion::h05d061a35e69cf644I8
   8:        0x10a4e440d - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::regions::h8041e0c5aa9e0a28bab
   9:        0x10a4e40c1 - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::contraregions::heb460ecd7a98a359B9a
  10:        0x10a4e6f06 - middle::typeck::infer::combine::Combine::closure_tys::h299389414609974291
  11:        0x10a483c7a - middle::typeck::infer::sub::Sub<'f, 'tcx>.Combine<'tcx>::tys::h01f60f96e1c7a0e0Mhb
  12:        0x10a482c9d - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::subtype::hc49b8b80a8fe6465BB2
  13:        0x10a482ba7 - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::tys::closure.134892
  14:        0x10a47fbc4 - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::unpack_actual_value::h17441466008346532517
  15:        0x10a47f974 - middle::typeck::infer::coercion::Coerce<'f, 'tcx>::tys::hea9dc90f9c7f79c4Wt2
  16:        0x10a4f1ce1 - middle::typeck::infer::mk_coercety::closure.136930
  17:        0x10a4f19cb - middle::typeck::infer::InferCtxt<'a, 'tcx>::commit_if_ok::closure.136922
  18:        0x10a4f1832 - middle::typeck::infer::InferCtxt<'a, 'tcx>::commit_unconditionally::h10269887564688594272
  19:        0x10a429559 - middle::typeck::infer::mk_coercety::hd859b51f9fb12384aGd
  20:        0x10a3d5608 - middle::typeck::check::FnCtxt<'a, 'tcx>::mk_assignty::h0f979b827d001669FbV
  21:        0x10a3d5468 - middle::typeck::check::demand::coerce::h17bc58cfa536c5eaUDP
  22:        0x10a4391c9 - middle::typeck::check::check_expr_coercable_to_type::closure.133875
  23:        0x10a432490 - middle::typeck::check::check_expr_with_unifier::h8eec84ce54d593054oW
  24:        0x10a3f9225 - middle::typeck::check::check_block_with_expected::h81c6310a053d62c16zY
  25:        0x10a3f4b52 - middle::typeck::check::check_fn::h698014d6a0124a77NcT
  26:        0x10a3f40c5 - middle::typeck::check::check_bare_fn::h148ba869b36fd48fV1S
  27:        0x10a3efe2b - middle::typeck::check::check_item::hd0bc87d8a336f4e0MlT
  28:        0x10a3f3f2f - middle::typeck::check::check_item_types::h557440a82bf61c1450S
  29:        0x109e6bfb6 - util::common::time::h9072582067505128456
  30:        0x10a6af15e - middle::typeck::check_crate::hca8fe6f296db2cadXRk
  31:        0x10a71b1af - driver::driver::phase_3_run_analysis_passes::h77649978e74b96betqx
  32:        0x10a7153af - driver::driver::compile_input::h1f2de5081accd1dcf7w
  33:        0x10a79e084 - driver::run_compiler::h00e7e552333d10b3yVA
  34:        0x10a79c1b6 - driver::run::closure.147372
  35:        0x109e8534b - task::TaskBuilder<S>::try_future::closure.101547
  36:        0x109e85233 - task::TaskBuilder<S>::spawn_internal::closure.101518
  37:        0x10b13979d - task::spawn_opts::closure.8528
  38:        0x10d5a595c - rust_try_inner
  39:        0x10d5a5946 - rust_try
  40:        0x10d53b507 - unwind::try::h518344f5564ef7c4rjd
  41:        0x10d53b38c - task::Task::run::h70777ea0d87a00a2Czc
  42:        0x10b1395c2 - task::spawn_opts::closure.8467
  43:        0x10d53cd4a - thread::thread_start::he25888157de1700cNTc
  44:     0x7fff8aa44352 - _pthread_start

Could not compile `promise`.

Caused by:
  Process didn't exit successfully: `rustc src/promise.rs --crate-name promise --crate-type lib -g -C metadata=3a86d92f1ae335d6 -C extra-filename=-3a86d92f1ae335d6 --out-dir /Users/hex/projects/active/promise/target --dep-info /Users/hex/projects/active/promise/target/.fingerprint/promise-3a86d92f1ae335d6/dep-lib-promise -L /Users/hex/projects/active/promise/target -L /Users/hex/projects/active/promise/target/deps` (status=101)

NOTE

It compiles fine if I add Send in a couple places, like so:

pub fn propagate<T:Promisable + Clone, E:Promisable + Clone>(action:proc(&T):Send -> Result<T, E>) -> proc(Result<T, E>):Send -> Result<T, E> {
  proc(result:Result<T, E>) {
    match result {
      Ok(ref t) => action(t),
      Err(ref e) => Err(e.clone()),
    }
  }
}
@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 19, 2014
bors added a commit that referenced this issue Dec 18, 2014
Closes #5988.
Closes #10176.
Closes #10456.
Closes #12744.
Closes #13264.
Closes #13324.
Closes #14182.
Closes #15381.
Closes #15444.
Closes #15480.
Closes #15756.
Closes #16822.
Closes #16966.
Closes #17351.
Closes #17503.
Closes #17545.
Closes #17771.
Closes #17816.
Closes #17897.
Closes #17905.
Closes #18188.
Closes #18232.
Closes #18345.
Closes #18389.
Closes #18400.
Closes #18502.
Closes #18611.
Closes #18783.
Closes #19009.
Closes #19081.
Closes #19098.
Closes #19127.
Closes #19135.
lnicola pushed a commit to lnicola/rust that referenced this issue Oct 8, 2024
Require rust 1.81

rust-analyzer doesn't build on 1.80 because we use `#[expect(lint)]`:
```
error[E0658]: the `#[expect]` attribute is an experimental feature
  --> crates/hir-expand/src/prettify_macro_expansion_.rs:11:1
   |
11 | #[expect(deprecated)]
   | ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue rust-lang#54503 <rust-lang#54503> for more information
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant