Rollup merge of #55199 - oli-obk:instance_printing, r=davidtwco

Impl items have generics
This commit is contained in:
kennytm 2018-10-28 21:38:53 +08:00
commit db4e77ce91
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
16 changed files with 34 additions and 35 deletions

View file

@ -1,4 +1,4 @@
error[E0606]: casting `fn(i32) -> Inches {Inches::{{constructor}}}` as `f32` is invalid
error[E0606]: casting `fn(i32) -> Inches {Inches}` as `f32` is invalid
--> $DIR/issue-21554.rs:14:5
|
LL | Inches as f32;

View file

@ -9,7 +9,7 @@ LL | fn test() -> Foo { Foo } //~ ERROR mismatched types
| expected `Foo` because of return type
|
= note: expected type `Foo`
found type `fn(u32) -> Foo {Foo::{{constructor}}}`
found type `fn(u32) -> Foo {Foo}`
error: aborting due to previous error

View file

@ -144,11 +144,11 @@ note: required by `check`
LL | fn check<T: Impossible>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `fn() -> c::TS {c::TS::{{constructor}}}: Impossible` is not satisfied
error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:66:5
|
LL | check(m3::TS); //~ ERROR c::TS
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS::{{constructor}}}`
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
|
note: required by `check`
--> $DIR/namespace-mix.rs:31:1
@ -192,11 +192,11 @@ note: required by `check`
LL | fn check<T: Impossible>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS::{{constructor}}}: Impossible` is not satisfied
error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:72:5
|
LL | check(xm3::TS); //~ ERROR c::TS
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS::{{constructor}}}`
| ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
|
note: required by `check`
--> $DIR/namespace-mix.rs:31:1

View file

@ -14,8 +14,8 @@
// error-pattern:static `PRIV_STATIC` is private
// error-pattern:type `ext::PrivEnum` is private
// error-pattern:type `fn() {<u8 as ext::PrivTrait>::method}` is private
// error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct::{{constructor}}}` is pr
// error-pattern:type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct::{{constructor}}}` is priv
// error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
// error-pattern:type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct}` is private
// error-pattern:type `for<'r> fn(&'r ext::Pub<u8>) {<ext::Pub<u8>>::priv_method}` is private
#![feature(decl_macro)]

View file

@ -30,7 +30,7 @@ LL | ext::m!();
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct::{{constructor}}}` is private
error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
--> $DIR/private-inferred-type-3.rs:26:5
|
LL | ext::m!();
@ -38,7 +38,7 @@ LL | ext::m!();
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct::{{constructor}}}` is private
error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct}` is private
--> $DIR/private-inferred-type-3.rs:26:5
|
LL | ext::m!();

View file

@ -53,9 +53,9 @@ mod m {
<u8 as PrivTrait>::method; //~ ERROR type `fn() {<u8 as m::PrivTrait>::method}` is private
<u8 as PubTrait>::method; // OK
PrivTupleStruct;
//~^ ERROR type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct::{{constructor}}}` is priv
//~^ ERROR type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct}` is private
PubTupleStruct;
//~^ ERROR type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct::{{constructor}}}` is privat
//~^ ERROR type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct}` is private
Pub(0u8).priv_method();
//~^ ERROR type `for<'r> fn(&'r m::Pub<u8>) {<m::Pub<u8>>::priv_method}` is private
}

View file

@ -115,7 +115,7 @@ LL | <u8 as PrivTrait>::method; //~ ERROR type `fn() {<u8 as m::PrivTrai
LL | m::m!();
| -------- in this macro invocation
error: type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct::{{constructor}}}` is private
error: type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct}` is private
--> $DIR/private-inferred-type.rs:55:9
|
LL | PrivTupleStruct;
@ -124,7 +124,7 @@ LL | PrivTupleStruct;
LL | m::m!();
| -------- in this macro invocation
error: type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct::{{constructor}}}` is private
error: type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct}` is private
--> $DIR/private-inferred-type.rs:57:9
|
LL | PubTupleStruct;