Skip to content

Internal compiler error anonymous bound region BrAnon(0) in binding but not trait ref #62200

Closed
@SeeSpring

Description

@SeeSpring

The following code causes an error

impl<'b, B: Ty<'b>, I: SIterator, F> SIterator for FilterMap<I, F> where
    F: FnMut(<I as Ty>::V) -> Option<<B as Ty>::V>
{}

pub trait SIterator: for<'a> Ty<'a> {}

pub trait Ty<'a> {
    type V;
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
error[E0465]: multiple rlib candidates for `debug_unreachable` found
  |
  = note: candidate #1: /playground/target/debug/deps/libdebug_unreachable-53cbbc8451f8a571.rlib
  = note: candidate #2: /playground/target/debug/deps/libdebug_unreachable-9f86ee3a7179ede7.rlib

error[E0412]: cannot find type `FilterMap` in this scope
 --> src/lib.rs:1:52
  |
1 | impl<'b, B: Ty<'b>, I: SIterator, F> SIterator for FilterMap<I, F> where
  |                                                    ^^^^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
  |
1 | use core::iter::FilterMap;
  |
1 | use futures::stream::FilterMap;
  |
1 | use itertools::__std_iter::FilterMap;
  |
1 | use rayon::iter::FilterMap;
  |
and 2 other candidates

error: internal compiler error: src/librustc_typeck/astconv.rs:1097: anonymous bound region BrAnon(0) in binding but not trait ref
 --> src/lib.rs:2:31
  |
2 |     F: FnMut(<I as Ty>::V) -> Option<<B as Ty>::V>
  |                               ^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:578:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 3 previous errors

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

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.37.0-nightly (b25ee6449 2019-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

Labels

A-trait-systemArea: Trait systemC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions