fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.7 KiB45 linesraw
1error[E0277]: the size for values of type `str` cannot be known at compilation time
2  --> $DIR/trivial-bounds-leak.rs:12:25
3   |
4LL | fn cant_return_str() -> str {
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/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
11error[E0599]: no method named `test` found for type `i32` in the current scope
12  --> $DIR/trivial-bounds-leak.rs:24:10
13   |
14LL |     3i32.test();
15   |          ^^^^ method not found in `i32`
16   |
17   = help: items from traits can only be used if the trait is implemented and in scope
18note: `Foo` defines an item `test`, perhaps you need to implement it
19  --> $DIR/trivial-bounds-leak.rs:4:1
20   |
21LL | pub trait Foo {
22   | ^^^^^^^^^^^^^
23
24error[E0277]: the trait bound `i32: Foo` is not satisfied
25  --> $DIR/trivial-bounds-leak.rs:25:15
26   |
27LL |     fn test(&self);
28   |     --------------- required by `Foo::test`
29...
30LL |     Foo::test(&4i32);
31   |               ^^^^^ the trait `Foo` is not implemented for `i32`
32
33error[E0277]: the trait bound `i32: Foo` is not satisfied
34  --> $DIR/trivial-bounds-leak.rs:26:22
35   |
36LL |     generic_function(5i32);
37   |                      ^^^^ the trait `Foo` is not implemented for `i32`
38...
39LL | fn generic_function<T: Foo>(t: T) {}
40   |    ----------------    --- required by this bound in `generic_function`
41
42error: aborting due to 4 previous errors
43
44Some errors have detailed explanations: E0277, E0599.
45For more information about an error, try `rustc --explain E0277`.