Move checks for renamed functions to __check_reserved_function_names (#3425)

* Move checks for renamed functions to `__check_reserved_function_names`

* Fix trybuild test
This commit is contained in:
Bastian Köcher
2019-08-17 01:14:21 +02:00
committed by GitHub
parent 6cc4495700
commit a0f2e9b396
3 changed files with 25 additions and 47 deletions
@@ -29,5 +29,4 @@ macro_rules! reserved {
reserved!(on_finalize on_initialize on_finalise on_initialise offchain_worker deposit_event);
fn main() {
}
fn main() {}
@@ -14,7 +14,7 @@ error: Invalid call fn name: `on_initialize`, name is reserved and doesn't match
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: Invalid call fn name: `on_finalise`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
error: `on_finalise` was renamed to `on_finalize`. Please rename your function accordingly.
--> $DIR/on_initialize.rs:30:1
|
30 | reserved!(on_finalize on_initialize on_finalise on_initialise offchain_worker deposit_event);
@@ -22,7 +22,7 @@ error: Invalid call fn name: `on_finalise`, name is reserved and doesn't match e
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: Invalid call fn name: `on_initialise`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword.
error: `on_initialise` was renamed to `on_initialize`. Please rename your function accordingly.
--> $DIR/on_initialize.rs:30:1
|
30 | reserved!(on_finalize on_initialize on_finalise on_initialise offchain_worker deposit_event);