Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expect for current_dir on librustc/session mod #45505

Merged
merged 3 commits into from
Oct 28, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,10 @@ pub fn build_session_(sopts: config::Options,
let print_fuel_crate = sopts.debugging_opts.print_fuel.clone();
let print_fuel = Cell::new(0);

let working_dir = env::current_dir().unwrap().to_string_lossy().into_owned();
let working_dir = match env::current_dir() {
Ok(dir) => dir.to_string_lossy().into_owned(),
Err(e) => panic!(p_s.span_diagnostic.fatal(&format!("Current directory is invalid: {}", e))),
Copy link
Member

@kennytm kennytm Oct 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is currently too long. This repository requires a 100-column limit.

[00:03:17] tidy error: /checkout/src/librustc/session/mod.rs:781: line longer than 100 chars

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops fixed in cfc916e

};
let working_dir = file_path_mapping.map_prefix(working_dir);

let sess = Session {
Expand Down