@@ -402,17 +402,19 @@ struct ProcDirective<'o> {
402402 can_be_disabled : bool ,
403403 set_at_definition : bool ,
404404 can_be_global : bool ,
405+ can_be_builtin : bool ,
405406 directive_string : & ' static str ,
406407}
407408
408409impl < ' o > ProcDirective < ' o > {
409- pub fn new ( directive_string : & ' static str , can_be_disabled : bool , set_at_definition : bool , can_be_global : bool ) -> ProcDirective < ' o > {
410+ pub fn new ( directive_string : & ' static str , can_be_disabled : bool , set_at_definition : bool , can_be_global : bool , can_be_builtin : bool ) -> ProcDirective < ' o > {
410411 ProcDirective {
411412 directive : Default :: default ( ) ,
412413 directive_string,
413414 can_be_disabled,
414415 set_at_definition,
415416 can_be_global,
417+ can_be_builtin,
416418 }
417419 }
418420
@@ -584,14 +586,14 @@ impl<'o> AnalyzeObjectTree<'o> {
584586 context,
585587 objtree,
586588 return_type,
587- must_call_parent : ProcDirective :: new ( "SpacemanDMM_should_call_parent" , true , false , false ) ,
588- must_not_override : ProcDirective :: new ( "SpacemanDMM_should_not_override" , false , false , false ) ,
589- private : ProcDirective :: new ( "SpacemanDMM_private_proc" , false , true , false ) ,
590- protected : ProcDirective :: new ( "SpacemanDMM_protected_proc" , false , true , false ) ,
591- must_not_sleep : ProcDirective :: new ( "SpacemanDMM_should_not_sleep" , false , true , true ) ,
592- sleep_exempt : ProcDirective :: new ( "SpacemanDMM_allowed_to_sleep" , false , true , true ) ,
593- must_be_pure : ProcDirective :: new ( "SpacemanDMM_should_be_pure" , false , true , true ) ,
594- can_be_redefined : ProcDirective :: new ( "SpacemanDMM_can_be_redefined" , false , false , false ) ,
589+ must_call_parent : ProcDirective :: new ( "SpacemanDMM_should_call_parent" , true , false , false , true ) ,
590+ must_not_override : ProcDirective :: new ( "SpacemanDMM_should_not_override" , false , false , false , false ) ,
591+ private : ProcDirective :: new ( "SpacemanDMM_private_proc" , false , true , false , false ) ,
592+ protected : ProcDirective :: new ( "SpacemanDMM_protected_proc" , false , true , false , false ) ,
593+ must_not_sleep : ProcDirective :: new ( "SpacemanDMM_should_not_sleep" , false , true , true , true ) ,
594+ sleep_exempt : ProcDirective :: new ( "SpacemanDMM_allowed_to_sleep" , false , true , true , true ) ,
595+ must_be_pure : ProcDirective :: new ( "SpacemanDMM_should_be_pure" , false , true , true , true ) ,
596+ can_be_redefined : ProcDirective :: new ( "SpacemanDMM_can_be_redefined" , false , false , false , false ) ,
595597 used_kwargs : Default :: default ( ) ,
596598 call_tree : Default :: default ( ) ,
597599 sleeping_procs : Default :: default ( ) ,
@@ -632,11 +634,13 @@ impl<'o> AnalyzeObjectTree<'o> {
632634
633635 if procdirective. set_at_definition {
634636 if let Some ( procdef) = & mut proc. get_declaration ( ) {
635- if procdef. location != proc. get ( ) . location {
636- error ( location, format ! ( "Can't define procs {} outside their initial definition" , directive) )
637- . set_severity ( Severity :: Warning )
638- . register ( self . context ) ;
639- return
637+ if !( procdef. location . is_builtins ( ) && procdirective. can_be_builtin ) {
638+ if procdef. location != proc. get ( ) . location {
639+ error ( location, format ! ( "Can't define procs {} outside their initial definition" , directive) )
640+ . set_severity ( Severity :: Warning )
641+ . register ( self . context ) ;
642+ return
643+ }
640644 }
641645 }
642646 }
0 commit comments