]> git.lizzy.rs Git - rust.git/blob - src/test/ui/trivial-bounds-leak.stderr
Rollup merge of #53082 - felixrabe:fix-doc-link-again, r=GuillaumeGomez
[rust.git] / src / test / ui / trivial-bounds-leak.stderr
1 error[E0277]: the size for values of type `str` cannot be known at compilation time
2   --> $DIR/trivial-bounds-leak.rs:22:25
3    |
4 LL | fn cant_return_str() -> str { //~ ERROR
5    |                         ^^^ doesn't have a size known at compile-time
6    |
7    = help: the trait `std::marker::Sized` is not implemented for `str`
8    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9    = note: the return type of a function must have a statically known size
10
11 error[E0599]: no method named `test` found for type `i32` in the current scope
12   --> $DIR/trivial-bounds-leak.rs:34:10
13    |
14 LL |     3i32.test(); //~ ERROR
15    |          ^^^^
16    |
17    = help: items from traits can only be used if the trait is implemented and in scope
18    = note: the following trait defines an item `test`, perhaps you need to implement it:
19            candidate #1: `Foo`
20
21 error[E0277]: the trait bound `i32: Foo` is not satisfied
22   --> $DIR/trivial-bounds-leak.rs:35:5
23    |
24 LL |     Foo::test(&4i32); //~ ERROR
25    |     ^^^^^^^^^ the trait `Foo` is not implemented for `i32`
26    |
27 note: required by `Foo::test`
28   --> $DIR/trivial-bounds-leak.rs:15:5
29    |
30 LL |     fn test(&self);
31    |     ^^^^^^^^^^^^^^^
32
33 error[E0277]: the trait bound `i32: Foo` is not satisfied
34   --> $DIR/trivial-bounds-leak.rs:36:5
35    |
36 LL |     generic_function(5i32); //~ ERROR
37    |     ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32`
38    |
39 note: required by `generic_function`
40   --> $DIR/trivial-bounds-leak.rs:39:1
41    |
42 LL | fn generic_function<T: Foo>(t: T) {}
43    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45 error: aborting due to 4 previous errors
46
47 Some errors occurred: E0277, E0599.
48 For more information about an error, try `rustc --explain E0277`.