File tree Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Expand file tree Collapse file tree 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -54,18 +54,8 @@ pub struct MacroDylib {
5454}
5555
5656impl 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 }
6959 }
7060}
7161
Original file line number Diff line number Diff line change @@ -648,8 +648,7 @@ pub(crate) fn load_proc_macro(
648648) -> ProcMacroLoadResult {
649649 let server = server. map_err ( ToOwned :: to_owned) ?;
650650 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 ( ) ) ;
653652 let vec = server. load_dylib ( dylib) . map_err ( |e| format ! ( "{e}" ) ) ?;
654653 if vec. is_empty ( ) {
655654 return Err ( "proc macro library returned no proc macros" . to_string ( ) ) ;
You can’t perform that action at this time.
0 commit comments