Skip to content

Commit

Permalink
Tidy up source file and fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
repnop authored and QuietMisdreavus committed Nov 1, 2018
1 parent b79fdb8 commit 43b65b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/librustdoc/test.rs
Expand Up @@ -407,7 +407,7 @@ pub fn make_test(s: &str,
let (already_has_main, already_has_extern_crate) = crate::syntax::with_globals(|| {
use crate::syntax::{ast, parse::{self, ParseSess}, source_map::FilePathMapping};
use crate::syntax_pos::FileName;

let filename = FileName::Anon;
let source = s.to_owned();
let sess = ParseSess::new(FilePathMapping::empty());
Expand All @@ -424,11 +424,11 @@ pub fn make_test(s: &str,
found_main = true;
}
}
}
if !found_extern_crate {
}

if !found_extern_crate {
if let ast::ItemKind::ExternCrate(original) = item.node {
// This code will never be reached if `cratename` is none ecause
// This code will never be reached if `cratename` is none because
// `found_extern_crate` is initialized to `true` if it is none.
let cratename = cratename.unwrap();

Expand Down Expand Up @@ -1051,7 +1051,7 @@ assert_eq!(2+2, 4);
#[test]
fn make_test_issues_21299_33731() {
let opts = TestOptions::default();

let input =
"// fn main
assert_eq!(2+2, 4);";
Expand Down

0 comments on commit 43b65b5

Please sign in to comment.