File tree 2 files changed +3
-14
lines changed
2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,8 @@ pub struct MacroDylib {
54
54
}
55
55
56
56
impl MacroDylib {
57
- // FIXME: this is buggy due to TOCTOU, we should check the version in the
58
- // macro process instead.
59
- pub fn new ( path : AbsPathBuf ) -> io:: Result < MacroDylib > {
60
- let _p = profile:: span ( "MacroDylib::new" ) ;
61
-
62
- let info = version:: read_dylib_info ( & path) ?;
63
- if info. version . 0 < 1 || info. version . 1 < 47 {
64
- let msg = format ! ( "proc-macro {} built by {info:#?} is not supported by rust-analyzer, please update your Rust version." , path. display( ) ) ;
65
- return Err ( io:: Error :: new ( io:: ErrorKind :: InvalidData , msg) ) ;
66
- }
67
-
68
- Ok ( MacroDylib { path } )
57
+ pub fn new ( path : AbsPathBuf ) -> MacroDylib {
58
+ MacroDylib { path }
69
59
}
70
60
}
71
61
Original file line number Diff line number Diff line change @@ -648,8 +648,7 @@ pub(crate) fn load_proc_macro(
648
648
) -> ProcMacroLoadResult {
649
649
let server = server. map_err ( ToOwned :: to_owned) ?;
650
650
let res: Result < Vec < _ > , String > = ( || {
651
- let dylib = MacroDylib :: new ( path. to_path_buf ( ) )
652
- . map_err ( |io| format ! ( "Proc-macro dylib loading failed: {io}" ) ) ?;
651
+ let dylib = MacroDylib :: new ( path. to_path_buf ( ) ) ;
653
652
let vec = server. load_dylib ( dylib) . map_err ( |e| format ! ( "{e}" ) ) ?;
654
653
if vec. is_empty ( ) {
655
654
return Err ( "proc macro library returned no proc macros" . to_string ( ) ) ;
You can’t perform that action at this time.
0 commit comments