Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/156699>.
//!
//! The target type of a `CoerceShared` impl that could not be normalized
//! used to cause an ICE instead of an error.

#![feature(reborrow)]

use std::marker::{CoerceShared, Reborrow};

struct Wrapper<'a, T>(&'a mut T);

impl<'a, T> Reborrow for Wrapper<'a, T> {}

impl<'a, T> CoerceShared<<T as Iterator>::Item> for Wrapper<'a, T> {}
//~^ ERROR `T` is not an iterator

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0277]: `T` is not an iterator
--> $DIR/coerce-shared-unnormalizable-target-issue-156699.rs:14:1
|
LL | impl<'a, T> CoerceShared<<T as Iterator>::Item> for Wrapper<'a, T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` is not an iterator
|
help: consider restricting type parameter `T` with trait `Iterator`
|
LL | impl<'a, T: std::iter::Iterator> CoerceShared<<T as Iterator>::Item> for Wrapper<'a, T> {}
| +++++++++++++++++++++

error: aborting due to 1 previous error

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