Add test for #132013
This commit is contained in:
parent
45089ec19e
commit
24ac777a64
@ -0,0 +1,20 @@
|
|||||||
|
//@ only-linux
|
||||||
|
//@ compile-flags: --error-format=human --color=always
|
||||||
|
//@ error-pattern: the trait bound
|
||||||
|
|
||||||
|
trait Foo<T>: Bar<T> {}
|
||||||
|
|
||||||
|
trait Bar<T> {}
|
||||||
|
|
||||||
|
struct Struct;
|
||||||
|
|
||||||
|
impl<T, K> Foo<K> for T where T: Bar<K>
|
||||||
|
{}
|
||||||
|
|
||||||
|
impl<'a> Bar<()> for Struct {}
|
||||||
|
|
||||||
|
fn foo() -> impl Foo<i32> {
|
||||||
|
Struct
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
@ -0,0 +1,62 @@
|
|||||||
|
<svg width="1104px" height="344px" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<style>
|
||||||
|
.fg { fill: #AAAAAA }
|
||||||
|
.bg { background: #000000 }
|
||||||
|
.fg-ansi256-009 { fill: #FF5555 }
|
||||||
|
.fg-ansi256-010 { fill: #55FF55 }
|
||||||
|
.fg-ansi256-012 { fill: #5555FF }
|
||||||
|
.fg-magenta { fill: #AA00AA }
|
||||||
|
.container {
|
||||||
|
padding: 0 10px;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
.bold { font-weight: bold; }
|
||||||
|
tspan {
|
||||||
|
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
|
||||||
|
white-space: pre;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||||
|
|
||||||
|
<text xml:space="preserve" class="container fg">
|
||||||
|
<tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[E0277]</tspan><tspan class="bold">: the trait bound `Struct: Foo<i32>` is not satisfied</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/highlight-difference-between-expected-trait-and-found-trait.rs:16:13</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> fn foo() -> impl Foo<i32> {</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">the trait `Bar<i32>` is not implemented for `Struct`, which is required by `Struct: Foo<i32>`</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">help</tspan><tspan>: the trait `Bar<()>` </tspan><tspan class="fg-magenta bold">is</tspan><tspan> implemented for `</tspan><tspan class="fg-magenta bold">Struct</tspan><tspan>`</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="154px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">help</tspan><tspan>: for that trait implementation, expected `()`, found `i32`</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="172px"><tspan class="fg-ansi256-010 bold">note</tspan><tspan>: required for `Struct` to implement `Foo<i32>`</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="190px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/highlight-difference-between-expected-trait-and-found-trait.rs:11:12</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="208px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="226px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> impl<T, K> Foo<K> for T where T: Bar<K></tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="244px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">unsatisfied trait bound introduced here</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="262px">
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="280px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 1 previous error</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="298px">
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="316px"><tspan class="bold">For more information about this error, try `rustc --explain E0277`.</tspan>
|
||||||
|
</tspan>
|
||||||
|
<tspan x="10px" y="334px">
|
||||||
|
</tspan>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
Loading…
Reference in New Issue
Block a user