Skip to content

Commit

Permalink
Remove duplicate function
Browse files Browse the repository at this point in the history
Function source_name declared in file

  src/librustc_driver/lib.rs

is a duplicate of a function by the same name declared in file

  src/librustc/session/config.rs
  • Loading branch information
aradzie committed Nov 19, 2019
1 parent 2cad8bb commit 303d2f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 0 additions & 7 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ const ICE_REPORT_COMPILER_FLAGS_EXCLUDE: &[&str] = &["metadata", "extra-filename

const ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE: &[&str] = &["incremental"];

pub fn source_name(input: &Input) -> FileName {
match *input {
Input::File(ref ifile) => ifile.clone().into(),
Input::Str { ref name, .. } => name.clone(),
}
}

pub fn abort_on_err<T>(result: Result<T, ErrorReported>, sess: &Session) -> T {
match result {
Err(..) => {
Expand Down
6 changes: 1 addition & 5 deletions src/librustc_driver/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ pub use self::PpSourceMode::*;
pub use self::PpMode::*;
use crate::abort_on_err;

use crate::source_name;



// This slightly awkward construction is to allow for each PpMode to
// choose whether it needs to do analyses (which can consume the
// Session) and then pass through the session (now attached to the
Expand Down Expand Up @@ -391,7 +387,7 @@ impl<'a, 'tcx> pprust_hir::PpAnn for TypedAnnotation<'a, 'tcx> {
}

fn get_source(input: &Input, sess: &Session) -> (String, FileName) {
let src_name = source_name(input);
let src_name = input.source_name();
let src = String::clone(&sess.source_map()
.get_source_file(&src_name)
.unwrap()
Expand Down

0 comments on commit 303d2f2

Please sign in to comment.