Skip to content

Rollup of 10 pull requests #52655

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

Merged
merged 21 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
53ae366
Remove obsolete flags in the i586_musl Dockerfile
ljedrz Jul 19, 2018
8b80c9f
Cursor: update docs to clarify Cursor only works with in-memory buffers
tko Jul 19, 2018
9369b52
Do not suggest using `to_owned()` on `&str += &str`
estebank Jul 22, 2018
bf2fc77
Fix color detection for Windows msys terminals.
ehuss Jul 22, 2018
59a435b
Use MultiSpan in E0707 and E709
Jul 22, 2018
814e6e6
Compile rustc before building tests for rustdoc
Mark-Simulacrum Jul 21, 2018
33b8f62
Don't use NonNull::dangling as sentinel value
RalfJung Jul 23, 2018
a303741
typos
RalfJung Jul 23, 2018
89495f3
Forget Waker when cloning LocalWaker
Thomasdezeeuw Jul 23, 2018
d89ac4c
Simplify 2 functions in rustc_mir/dataflow
ljedrz Jul 23, 2018
fe588d8
Replace a few expect+format combos with unwrap_or_else+panic
ljedrz Jul 23, 2018
cf995d6
Rollup merge of #52538 - ljedrz:old_musl_i586_flags, r=kennytm
kennytm Jul 24, 2018
a98c19e
Rollup merge of #52548 - tko:cursor-doc, r=sfackler
kennytm Jul 24, 2018
5b7e3a1
Rollup merge of #52605 - estebank:str-plus-eq, r=oli-obk
kennytm Jul 24, 2018
85bb13c
Rollup merge of #52621 - ehuss:atty-fix, r=alexcrichton
kennytm Jul 24, 2018
291a620
Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
kennytm Jul 24, 2018
4084f0e
Rollup merge of #52627 - Mark-Simulacrum:rustdoc-test-correct, r=alex…
kennytm Jul 24, 2018
3af372a
Rollup merge of #52637 - RalfJung:rc, r=joshtriplett
kennytm Jul 24, 2018
b3c9fe2
Rollup merge of #52640 - Thomasdezeeuw:fix-localwaker-clone, r=cramertj
kennytm Jul 24, 2018
378ef99
Rollup merge of #52641 - ljedrz:mir_dataflow_misc, r=cramertj
kennytm Jul 24, 2018
3efc612
Rollup merge of #52642 - ljedrz:expect_fun_call, r=Mark-Simulacrum
kennytm Jul 24, 2018
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
Prev Previous commit
Next Next commit
Replace a few expect+format combos with unwrap_or_else+panic
  • Loading branch information
ljedrz committed Jul 23, 2018
commit fe588d894fa392fdf787c18a959b342d38d0c71c
4 changes: 2 additions & 2 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ fn main() {
let start = Instant::now();
let status = cmd
.status()
.expect(&format!("\n\n failed to run {:?}", cmd));
.unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
let dur = start.elapsed();

let is_test = args.iter().any(|a| a == "--test");
Expand All @@ -346,7 +346,7 @@ fn main() {
}
}

let code = exec_cmd(&mut cmd).expect(&format!("\n\n failed to run {:?}", cmd));
let code = exec_cmd(&mut cmd).unwrap_or_else(|_| panic!("\n\n failed to run {:?}", cmd));
std::process::exit(code);
}

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn install_sh(
let libdir_default = PathBuf::from("lib");
let mandir_default = datadir_default.join("man");
let prefix = builder.config.prefix.as_ref().map_or(prefix_default, |p| {
fs::canonicalize(p).expect(&format!("could not canonicalize {}", p.display()))
fs::canonicalize(p).unwrap_or_else(|_| panic!("could not canonicalize {}", p.display()))
});
let sysconfdir = builder.config.sysconfdir.as_ref().unwrap_or(&sysconfdir_default);
let datadir = builder.config.datadir.as_ref().unwrap_or(&datadir_default);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String
let mut output = cwd.join(&config.out_filename);
output.pop();
let output = fs::canonicalize(&output).unwrap_or(output);
let relative = path_relative_from(&lib, &output)
.expect(&format!("couldn't create relative path from {:?} to {:?}", output, lib));
let relative = path_relative_from(&lib, &output).unwrap_or_else(||
panic!("couldn't create relative path from {:?} to {:?}", output, lib));
// FIXME (#9639): This needs to handle non-utf8 paths
format!("{}/{}", prefix,
relative.to_str().expect("non-utf8 component in path"))
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ pub fn provide(providers: &mut Providers) {
all.iter()
.find(|cgu| *cgu.name() == name)
.cloned()
.expect(&format!("failed to find cgu with name {:?}", name))
.unwrap_or_else(|| panic!("failed to find cgu with name {:?}", name))
};
providers.compile_codegen_unit = compile_codegen_unit;

Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax_ext/format_foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ pub mod printf {
impl Num {
fn from_str(s: &str, arg: Option<&str>) -> Self {
if let Some(arg) = arg {
Num::Arg(arg.parse().expect(&format!("invalid format arg `{:?}`", arg)))
Num::Arg(arg.parse().unwrap_or_else(|_| panic!("invalid format arg `{:?}`", arg)))
} else if s == "*" {
Num::Next
} else {
Num::Num(s.parse().expect(&format!("invalid format num `{:?}`", s)))
Num::Num(s.parse().unwrap_or_else(|_| panic!("invalid format num `{:?}`", s)))
}
}

Expand Down