-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #987 from verus-lang/remove-custom-vstd-build-driver
Remove custom vstd build driver
- Loading branch information
Showing
14 changed files
with
72 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,11 @@ | ||
/// A rustc file loader that remaps "pervasive" to a user-provided path | ||
#[derive(Clone)] | ||
pub struct PervasiveFileLoader { | ||
pervasive_path: Option<String>, | ||
} | ||
|
||
impl PervasiveFileLoader { | ||
pub fn new(pervasive_path: Option<String>) -> Self { | ||
Self { pervasive_path } | ||
} | ||
pub use rustc_span::source_map::RealFileLoader; | ||
|
||
fn remap_pervasive_path(&self, path: &std::path::Path) -> std::path::PathBuf { | ||
if let Some(pervasive_path) = &self.pervasive_path { | ||
if path.parent().and_then(|x| x.file_name()) == Some(std::ffi::OsStr::new("pervasive")) | ||
{ | ||
if let Some(file_name) = path.file_name() { | ||
return std::path::Path::new(pervasive_path).join(file_name).into(); | ||
} | ||
} | ||
} | ||
path.into() | ||
} | ||
pub trait FileLoaderClone { | ||
fn clone(&self) -> Self; | ||
} | ||
|
||
impl rustc_span::source_map::FileLoader for PervasiveFileLoader { | ||
fn file_exists(&self, path: &std::path::Path) -> bool { | ||
let path = self.remap_pervasive_path(path); | ||
rustc_span::source_map::RealFileLoader.file_exists(&path) | ||
} | ||
|
||
fn read_file(&self, path: &std::path::Path) -> Result<String, std::io::Error> { | ||
let path = self.remap_pervasive_path(path); | ||
rustc_span::source_map::RealFileLoader.read_file(&path) | ||
} | ||
|
||
fn read_binary_file(&self, path: &std::path::Path) -> Result<Vec<u8>, std::io::Error> { | ||
let path = self.remap_pervasive_path(path); | ||
rustc_span::source_map::RealFileLoader.read_binary_file(&path) | ||
impl FileLoaderClone for RealFileLoader { | ||
fn clone(&self) -> Self { | ||
rustc_span::source_map::RealFileLoader | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.