"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tools/rustfmt/src/modules.rs" between
rustc-1.45.0-src.tar.xz and rustc-1.45.2-src.tar.xz

About: Rust is a systems programming language that runs "blazingly fast, prevents nearly all segfaults, and guarantees thread safety" (developed by Mozilla).

modules.rs  (rustc-1.45.0-src.tar.xz):modules.rs  (rustc-1.45.2-src.tar.xz)
skipping to change at line 255 skipping to change at line 255
) -> Result<Option<SubModKind<'c, 'ast>>, String> { ) -> Result<Option<SubModKind<'c, 'ast>>, String> {
let relative = match self.directory.ownership { let relative = match self.directory.ownership {
DirectoryOwnership::Owned { relative } => relative, DirectoryOwnership::Owned { relative } => relative,
DirectoryOwnership::UnownedViaBlock | DirectoryOwnership::UnownedVia Mod => None, DirectoryOwnership::UnownedViaBlock | DirectoryOwnership::UnownedVia Mod => None,
}; };
if let Some(path) = Parser::submod_path_from_attr(attrs, &self.directory .path) { if let Some(path) = Parser::submod_path_from_attr(attrs, &self.directory .path) {
if self.parse_sess.is_file_parsed(&path) { if self.parse_sess.is_file_parsed(&path) {
return Ok(None); return Ok(None);
} }
return match Parser::parse_file_as_module(self.parse_sess, &path, su b_mod.inner) { return match Parser::parse_file_as_module(self.parse_sess, &path, su b_mod.inner) {
Some(m) => Ok(Some(SubModKind::External( Some((_, ref attrs)) if contains_skip(attrs) => Ok(None),
Some((m, _)) => Ok(Some(SubModKind::External(
path, path,
DirectoryOwnership::Owned { relative: None }, DirectoryOwnership::Owned { relative: None },
Cow::Owned(m), Cow::Owned(m),
))), ))),
None => Err(format!( None => Err(format!(
"Failed to find module {} in {:?} {:?}", "Failed to find module {} in {:?} {:?}",
mod_name, self.directory.path, relative, mod_name, self.directory.path, relative,
)), )),
}; };
} }
skipping to change at line 293 skipping to change at line 294
if outside_mods_empty { if outside_mods_empty {
return Ok(None); return Ok(None);
} else { } else {
if should_insert { if should_insert {
mods_outside_ast.push((path, ownership, sub_mod.clon e())); mods_outside_ast.push((path, ownership, sub_mod.clon e()));
} }
return Ok(Some(SubModKind::MultiExternal(mods_outside_as t))); return Ok(Some(SubModKind::MultiExternal(mods_outside_as t)));
} }
} }
match Parser::parse_file_as_module(self.parse_sess, &path, sub_m od.inner) { match Parser::parse_file_as_module(self.parse_sess, &path, sub_m od.inner) {
Some(m) if outside_mods_empty => { Some((_, ref attrs)) if contains_skip(attrs) => Ok(None),
Some((m, _)) if outside_mods_empty => {
Ok(Some(SubModKind::External(path, ownership, Cow::Owned (m)))) Ok(Some(SubModKind::External(path, ownership, Cow::Owned (m))))
} }
Some(m) => { Some((m, _)) => {
mods_outside_ast.push((path.clone(), ownership, Cow::Own ed(m))); mods_outside_ast.push((path.clone(), ownership, Cow::Own ed(m)));
if should_insert { if should_insert {
mods_outside_ast.push((path, ownership, sub_mod.clon e())); mods_outside_ast.push((path, ownership, sub_mod.clon e()));
} }
Ok(Some(SubModKind::MultiExternal(mods_outside_ast))) Ok(Some(SubModKind::MultiExternal(mods_outside_ast)))
} }
None if outside_mods_empty => Err(format!( None if outside_mods_empty => Err(format!(
"Failed to find module {} in {:?} {:?}", "Failed to find module {} in {:?} {:?}",
mod_name, self.directory.path, relative, mod_name, self.directory.path, relative,
)), )),
skipping to change at line 380 skipping to change at line 382
// If the specified file is already parsed, then we just use tha t. // If the specified file is already parsed, then we just use tha t.
result.push(( result.push((
actual_path, actual_path,
DirectoryOwnership::Owned { relative: None }, DirectoryOwnership::Owned { relative: None },
sub_mod.clone(), sub_mod.clone(),
)); ));
continue; continue;
} }
let m = match Parser::parse_file_as_module(self.parse_sess, &actual_ path, sub_mod.inner) let m = match Parser::parse_file_as_module(self.parse_sess, &actual_ path, sub_mod.inner)
{ {
Some(m) => m, Some((_, ref attrs)) if contains_skip(attrs) => continue,
Some((m, _)) => m,
None => continue, None => continue,
}; };
result.push(( result.push((
actual_path, actual_path,
DirectoryOwnership::Owned { relative: None }, DirectoryOwnership::Owned { relative: None },
Cow::Owned(m), Cow::Owned(m),
)) ))
} }
result result
 End of changes. 4 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)