2018-07-10 16:10:13 -05:00
|
|
|
error[E0277]: the size for values of type `str` cannot be known at compilation time
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/trivial-bounds-leak.rs:12:25
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | fn cant_return_str() -> str {
|
2018-06-19 17:53:51 -05:00
|
|
|
| ^^^ doesn't have a size known at compile-time
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: the trait `Sized` is not implemented for `str`
|
2018-05-06 16:54:00 -05: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
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/trivial-bounds-leak.rs:24:10
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | 3i32.test();
|
2019-09-06 14:00:07 -05:00
|
|
|
| ^^^^ method not found in `i32`
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
|
|
|
= help: items from traits can only be used if the trait is implemented and in scope
|
2020-02-24 20:55:51 -06:00
|
|
|
note: `Foo` defines an item `test`, perhaps you need to implement it
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:4:1
|
|
|
|
|
|
|
|
|
LL | pub trait Foo {
|
|
|
|
| ^^^^^^^^^^^^^
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `i32: Foo` is not satisfied
|
2019-09-15 23:58:20 -05:00
|
|
|
--> $DIR/trivial-bounds-leak.rs:25:15
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | Foo::test(&4i32);
|
2021-09-07 06:30:53 -05:00
|
|
|
| --------- ^^^^^ the trait `Foo` is not implemented for `i32`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2023-09-09 22:33:07 -05:00
|
|
|
|
|
|
|
|
help: this trait has no implementations, consider adding one
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:4:1
|
|
|
|
|
|
|
|
|
LL | pub trait Foo {
|
|
|
|
| ^^^^^^^^^^^^^
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `i32: Foo` is not satisfied
|
2019-09-15 23:58:20 -05:00
|
|
|
--> $DIR/trivial-bounds-leak.rs:26:22
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | generic_function(5i32);
|
2021-09-07 06:30:53 -05:00
|
|
|
| ---------------- ^^^^ the trait `Foo` is not implemented for `i32`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
2023-09-09 22:33:07 -05:00
|
|
|
help: this trait has no implementations, consider adding one
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:4:1
|
|
|
|
|
|
|
|
|
LL | pub trait Foo {
|
|
|
|
| ^^^^^^^^^^^^^
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `generic_function`
|
|
|
|
--> $DIR/trivial-bounds-leak.rs:29:24
|
|
|
|
|
|
2018-05-06 16:54:00 -05:00
|
|
|
LL | fn generic_function<T: Foo>(t: T) {}
|
2021-07-31 11:26:55 -05:00
|
|
|
| ^^^ required by this bound in `generic_function`
|
2018-05-06 16:54:00 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0277, E0599.
|
2018-05-06 16:54:00 -05:00
|
|
|
For more information about an error, try `rustc --explain E0277`.
|