blob: 4425caee39e3fec66949ef89ea1bb1150589b432 [file] [edit]
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:13:14
|
LL | pat1: fn(1..3: bool),
| ^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat1: fn(1..3: bool),
LL + pat1: fn(_: bool),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:15:14
|
LL | pat2: fn((x, y): (bool, bool)),
| ^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat2: fn((x, y): (bool, bool)),
LL + pat2: fn(_: (bool, bool)),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:17:14
|
LL | pat3: fn(Thing { a, b }: Thing),
| ^^^^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat3: fn(Thing { a, b }: Thing),
LL + pat3: fn(_: Thing),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:19:14
|
LL | pat4: fn(NoThing { a, b }: NoThing),
| ^^^^^^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat4: fn(NoThing { a, b }: NoThing),
LL + pat4: fn(_: NoThing),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:22:14
|
LL | pat5: fn((((((x))))): bool),
| ^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat5: fn((((((x))))): bool),
LL + pat5: fn(_: bool),
|
error: unexpected `self` parameter in function
--> $DIR/fn-ptr-pattern.rs:27:21
|
LL | self2: fn(self, self),
| ^^^^ must be the first parameter of an associated function
error: unexpected `self` parameter in function
--> $DIR/fn-ptr-pattern.rs:30:21
|
LL | self3: fn(bool, self),
| ^^^^ must be the first parameter of an associated function
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:50:14
|
LL | pat1: fn(1..3: bool),
| ^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat1: fn(1..3: bool),
LL + pat1: fn(_: bool),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:52:14
|
LL | pat2: fn((x, y): (bool, bool)),
| ^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat2: fn((x, y): (bool, bool)),
LL + pat2: fn(_: (bool, bool)),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:54:14
|
LL | pat3: fn(Thing { a, b }: Thing),
| ^^^^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat3: fn(Thing { a, b }: Thing),
LL + pat3: fn(_: Thing),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:56:14
|
LL | pat4: fn(NoThing { a, b }: NoThing),
| ^^^^^^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat4: fn(NoThing { a, b }: NoThing),
LL + pat4: fn(_: NoThing),
|
error[E0642]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:58:14
|
LL | pat5: fn((((((x))))): bool),
| ^^^^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL - pat5: fn((((((x))))): bool),
LL + pat5: fn(_: bool),
|
error: unexpected `self` parameter in function
--> $DIR/fn-ptr-pattern.rs:62:21
|
LL | self2: fn(self, self),
| ^^^^ must be the first parameter of an associated function
error: unexpected `self` parameter in function
--> $DIR/fn-ptr-pattern.rs:64:21
|
LL | self3: fn(bool, self),
| ^^^^ must be the first parameter of an associated function
error: `self` parameter is only allowed in associated functions
--> $DIR/fn-ptr-pattern.rs:25:15
|
LL | self1: fn(self),
| ^^^^ not semantically valid as function parameter
|
= note: associated functions are those in `impl` or `trait` definitions
error: `self` parameter is only allowed in associated functions
--> $DIR/fn-ptr-pattern.rs:27:15
|
LL | self2: fn(self, self),
| ^^^^ not semantically valid as function parameter
|
= note: associated functions are those in `impl` or `trait` definitions
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:33:25
|
LL | restricted_pat1: fn(mut x: ()),
| ^^^^^
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:35:25
|
LL | restricted_pat2: fn(&x: ()),
| ^^
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:37:25
|
LL | restricted_pat3: fn(&&x: ()),
| ^^^
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:39:25
|
LL | restricted_pat4: fn(false: ()),
| ^^^^^
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:41:25
|
LL | restricted_pat5: fn(&_: ()),
| ^^
error[E0561]: patterns aren't allowed in function pointer types
--> $DIR/fn-ptr-pattern.rs:43:25
|
LL | restricted_pat6: fn(&true: ()),
| ^^^^^
error[E0425]: cannot find type `NoThing` in this scope
--> $DIR/fn-ptr-pattern.rs:19:32
|
LL | pat4: fn(NoThing { a, b }: NoThing),
| ^^^^^^^ not found in this scope
|
note: similarly named struct `Thing` defined here
--> $DIR/fn-ptr-pattern.rs:75:1
|
LL | struct Thing { a: bool, b: bool }
| ^^^^^^^^^^^^
help: a struct with a similar name exists
|
LL - pat4: fn(NoThing { a, b }: NoThing),
LL + pat4: fn(NoThing { a, b }: Thing),
|
error: aborting due to 23 previous errors
Some errors have detailed explanations: E0425, E0561, E0642.
For more information about an error, try `rustc --explain E0425`.