2018-07-10 23:10:13 +02:00
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-05-06 22:54:00 +01:00
|
|
|
--> $DIR/trivial-bounds-leak.rs:22:25
|
|
|
|
|
|
|
|
|
LL | fn cant_return_str() -> str { //~ ERROR
|
2018-06-19 15:53:51 -07:00
|
|
|
| ^^^ doesn't have a size known at compile-time
|
2018-05-06 22:54:00 +01:00
|
|
|
|
|
|
|
|
= help: the trait `std::marker::Sized` is not implemented for `str`
|
2018-07-15 19:10:47 +02:00
|
|
|
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
|
2018-05-06 22:54:00 +01:00
|
|
|
= note: the return type of a function must have a statically known size
|
|
|
|
|
|
|
|
error[E0599]: no method named `test` found for type `i32` in the current scope
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:34:10
|
|
|
|
|
|
|
|
|
LL | 3i32.test(); //~ ERROR
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is implemented and in scope
|
|
|
|
= note: the following trait defines an item `test`, perhaps you need to implement it:
|
|
|
|
candidate #1: `Foo`
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `i32: Foo` is not satisfied
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:35:5
|
|
|
|
|
|
|
|
|
LL | Foo::test(&4i32); //~ ERROR
|
|
|
|
| ^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
|
|
|
|
|
|
|
|
note: required by `Foo::test`
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:15:5
|
|
|
|
|
|
|
|
|
LL | fn test(&self);
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `i32: Foo` is not satisfied
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:36:5
|
|
|
|
|
|
|
|
|
LL | generic_function(5i32); //~ ERROR
|
|
|
|
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
|
|
|
|
|
|
|
|
|
note: required by `generic_function`
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:39:1
|
|
|
|
|
|
|
|
|
LL | fn generic_function<T: Foo>(t: T) {}
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
Some errors occurred: E0277, E0599.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|