rustc_parse

Function new_parser_from_file

Source
pub fn new_parser_from_file<'a>(
    psess: &'a ParseSess,
    path: &Path,
    sp: Option<Span>,
) -> Result<Parser<'a>, Vec<Diag<'a>>>
Expand description

Creates a new parser from a filename. On failure, the errors must be consumed via unwrap_or_emit_fatal, emit, cancel, etc., otherwise a panic will occur when they are dropped.

If a span is given, that is used on an error as the source of the problem.