2024-03-22 13:54:17 -05:00
|
|
|
error[E0401]: can't use generic parameters from outer item
|
2024-03-26 10:59:03 -05:00
|
|
|
--> $DIR/target-expr.rs:20:17
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
|
LL | fn bar<T: Default>(_: T) {
|
|
|
|
| - type parameter from outer item
|
|
|
|
LL | reuse Trait::static_method {
|
|
|
|
| - help: try introducing a local generic parameter here: `T,`
|
|
|
|
...
|
|
|
|
LL | let _ = T::Default();
|
|
|
|
| ^^^^^^^^^^ use of generic parameter from outer item
|
|
|
|
|
|
|
|
error[E0434]: can't capture dynamic environment in a fn item
|
2024-03-26 10:59:03 -05:00
|
|
|
--> $DIR/target-expr.rs:29:17
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
|
LL | let x = y;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= help: use the `|| { ... }` closure form instead
|
|
|
|
|
|
|
|
error[E0424]: expected value, found module `self`
|
2024-03-26 10:59:03 -05:00
|
|
|
--> $DIR/target-expr.rs:36:5
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
|
LL | fn main() {
|
|
|
|
| ---- this function can't have a `self` parameter
|
|
|
|
...
|
|
|
|
LL | self.0;
|
|
|
|
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
|
|
|
|
|
|
|
error[E0425]: cannot find value `x` in this scope
|
2024-03-26 10:59:03 -05:00
|
|
|
--> $DIR/target-expr.rs:38:13
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
|
LL | let z = x;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
help: the binding `x` is available in a different scope in the same function
|
2024-03-26 10:59:03 -05:00
|
|
|
--> $DIR/target-expr.rs:29:13
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
|
LL | let x = y;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: delegation with early bound generics is not supported yet
|
|
|
|
--> $DIR/target-expr.rs:16:18
|
|
|
|
|
|
|
|
|
LL | fn static_method(x: i32) -> i32 { x }
|
|
|
|
| ------------------------------- callee defined here
|
|
|
|
...
|
|
|
|
LL | reuse Trait::static_method {
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
2024-03-26 10:59:03 -05:00
|
|
|
error: delegation to a trait method from a free function is not supported yet
|
|
|
|
--> $DIR/target-expr.rs:16:18
|
|
|
|
|
|
|
|
|
LL | fn static_method(x: i32) -> i32 { x }
|
|
|
|
| ------------------------------- callee defined here
|
|
|
|
...
|
|
|
|
LL | reuse Trait::static_method {
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: delegation to a trait method from a free function is not supported yet
|
|
|
|
--> $DIR/target-expr.rs:27:25
|
|
|
|
|
|
|
|
|
LL | fn static_method(x: i32) -> i32 { x }
|
|
|
|
| ------------------------------- callee defined here
|
|
|
|
...
|
|
|
|
LL | reuse <S as Trait>::static_method {
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
2024-03-22 13:54:17 -05:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/target-expr.rs:16:32
|
|
|
|
|
|
|
|
|
LL | reuse Trait::static_method {
|
|
|
|
| ________________________________^
|
|
|
|
LL | |
|
|
|
|
LL | |
|
2024-03-26 10:59:03 -05:00
|
|
|
LL | |
|
2024-03-22 13:54:17 -05:00
|
|
|
LL | | let _ = T::Default();
|
|
|
|
LL | |
|
|
|
|
LL | | }
|
|
|
|
| |_____^ expected `i32`, found `()`
|
|
|
|
|
2024-03-26 10:59:03 -05:00
|
|
|
error: aborting due to 8 previous errors
|
2024-03-22 13:54:17 -05:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0308, E0401, E0424, E0425, E0434.
|
|
|
|
For more information about an error, try `rustc --explain E0308`.
|