File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ impl PathX {
5959 _ => false ,
6060 }
6161 }
62+
63+ pub fn is_vstd_path ( & self ) -> bool {
64+ match & self . krate {
65+ Some ( k) if & * * k == "vstd" => true ,
66+ _ => false ,
67+ }
68+ }
6269}
6370
6471pub fn path_segments_match_prefix ( target : & Idents , prefix : & Idents ) -> bool {
Original file line number Diff line number Diff line change @@ -1174,10 +1174,16 @@ fn check_function(
11741174 }
11751175
11761176 if ctxt. no_cheating && ( function. x . attrs . is_external_body || function. x . proxy . is_some ( ) ) {
1177- return Err ( error (
1178- & function. span ,
1179- "external_body/assume_specification not allowed with --no-cheating" ,
1180- ) ) ;
1177+ match & function. x . owning_module {
1178+ // Allow external_body/assume_specification inside vstd
1179+ Some ( path) if path. is_vstd_path ( ) => { }
1180+ _ => {
1181+ return Err ( error (
1182+ & function. span ,
1183+ "external_body/assume_specification not allowed with --no-cheating" ,
1184+ ) ) ;
1185+ }
1186+ }
11811187 }
11821188
11831189 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments