lib/rust_require/rustc.rb
# Analyze @tempfile with the lint
# create an info.json file in @subdir
Analyze @tempfile with the lint
create an info.json file in @subdir
Analyze @tempfile with the lint create an info . json file in @subdir
def analyze_tempfile
      File.open(@tempfile, 'w+') do |f|
        f << "#![feature(plugin)]\n#![plugin(source_analyzer)]\n"
        File.open(@input_path, "r") { |input| f << input.read }
      end
      print `RUST_REQUIRE_FILE=#{@info_file_path} #{RUSTC_CMD} -Z no-trans -L #{File.dirname(@input_path)} -L #{File.dirname(SOURCE_ANALYZER)} #{@tempfile}`
      raise "rust compiler error" if $? != 0
      File.open(@tempfile, 'w+') do |f|
        File.open(@input_path, "r") { |input| f << input.read }
      end
    end
def analyze_tempfile File . open ( @tempfile , 'w+' ) do | f | f << "#![feature(plugin)]\n#![plugin(source_analyzer)]\n" File . open ( @input_path , "r" ) { | input | f << input . read } end print ` RUST_REQUIRE_FILE= #{ @info_file_path } #{ RUSTC_CMD }  -Z no-trans -L  #{ File . dirname ( @input_path ) }  -L  #{ File . dirname ( SOURCE_ANALYZER ) } #{ @tempfile } ` raise "rust compiler error" if $? != 0 File . open ( @tempfile , 'w+' ) do | f | File . open ( @input_path , "r" ) { | input | f << input . read } end end
Analyze @tempfile with the lint
create an info.json file in @subdir
Analyze @tempfile with the lint create an info . json file in @subdir
# injection of the librust_grep_lints plugin # add the actual file content # use the lint to just parse the file (no code generation) # remove the injected lint plugin again # add just the actual file content