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

Rollup of 9 pull requests #82547

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c28f2a8
Stabilize str_split_once
jhpratt Feb 9, 2021
4c70372
Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to m…
GuillaumeGomez Feb 15, 2021
5ff1be1
replaced some unwrap_or with unwrap_or_else
klensy Feb 23, 2021
c75c4a5
replaced some map_or with map_or_else
klensy Feb 23, 2021
6d5c0c1
Consider inexpensive inlining criteria first
tmiasko Feb 24, 2021
08b1e80
fix review
klensy Feb 25, 2021
fb24a10
Properly account for non-shorthand pattern field in unused variable lint
estebank Feb 25, 2021
356beb3
clarifies error when finding mismatched returned types for async func…
nellshamrell Feb 15, 2021
e130e9c
Update measureme dependency to the latest version
wesleywiser Feb 25, 2021
9d3739d
Set codegen thread names
wesleywiser Feb 18, 2021
c47903f
Add optional woff2 versions of FiraSans.
jsha Feb 26, 2021
ad7ed13
Embed woff2 files in rustdoc binary.
jsha Feb 26, 2021
91c246b
Rollup merge of #80845 - GuillaumeGomez:item-kind-transition, r=jyn514
GuillaumeGomez Feb 26, 2021
dc34ead
Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-se
GuillaumeGomez Feb 26, 2021
3ddc7d4
Rollup merge of #82165 - nellshamrell:nell/fix-80658-B, r=estebank
GuillaumeGomez Feb 26, 2021
e11393a
Rollup merge of #82456 - klensy:or-else, r=estebank
GuillaumeGomez Feb 26, 2021
443c483
Rollup merge of #82491 - tmiasko:i, r=lcnr
GuillaumeGomez Feb 26, 2021
f6e77e8
Rollup merge of #82506 - estebank:unused_variable_lint, r=lcnr
GuillaumeGomez Feb 26, 2021
5964b43
Rollup merge of #82535 - wesleywiser:wip_codegen_thread_names, r=nagisa
GuillaumeGomez Feb 26, 2021
812d78f
Rollup merge of #82537 - wesleywiser:update_measureme, r=oli-obk
GuillaumeGomez Feb 26, 2021
65f3751
Rollup merge of #82545 - jsha:woff2, r=GuillaumeGomez
GuillaumeGomez Feb 26, 2021
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
replaced some unwrap_or with unwrap_or_else
  • Loading branch information
klensy committed Feb 23, 2021
commit 5ff1be197eaa8a014718b26b1fcbe0ced33b6e1a
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
@@ -2082,7 +2082,7 @@ fn add_upstream_rust_crates<'a, B: ArchiveBuilder<'a>>(
let filestem = cratepath.file_stem().unwrap().to_str().unwrap();
cmd.link_rust_dylib(
Symbol::intern(&unlib(&sess.target, filestem)),
parent.unwrap_or(Path::new("")),
parent.unwrap_or_else(|| Path::new("")),
);
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/non_fmt_panic.rs
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@ fn check_panic_str<'tcx>(
Some(v) if v.len() == 1 => "panic message contains a brace",
_ => "panic message contains braces",
};
cx.struct_span_lint(NON_FMT_PANIC, brace_spans.unwrap_or(vec![span]), |lint| {
cx.struct_span_lint(NON_FMT_PANIC, brace_spans.unwrap_or_else(|| vec![span]), |lint| {
let mut l = lint.build(msg);
l.note("this message is not used as a format string, but will be in Rust 2021");
if span.contains(arg.span) {
4 changes: 2 additions & 2 deletions compiler/rustc_macros/src/query.rs
Original file line number Diff line number Diff line change
@@ -378,14 +378,14 @@ fn add_query_description_impl(
let t = &(t.0).0;
quote! { #t }
})
.unwrap_or(quote! { _ });
.unwrap_or_else(|| quote! { _ });
let value = args
.as_ref()
.map(|t| {
let t = &(t.1).0;
quote! { #t }
})
.unwrap_or(quote! { _ });
.unwrap_or_else(|| quote! { _ });
// expr is a `Block`, meaning that `{ #expr }` gets expanded
// to `{ { stmts... } }`, which triggers the `unused_braces` lint.
quote! {
6 changes: 3 additions & 3 deletions compiler/rustc_macros/src/session_diagnostic.rs
Original file line number Diff line number Diff line change
@@ -473,9 +473,9 @@ impl<'a> SessionDiagnosticDeriveBuilder<'a> {
.map(
|applicability_idx| quote!(#binding.#applicability_idx),
)
.unwrap_or(quote!(
rustc_errors::Applicability::Unspecified
));
.unwrap_or_else(|| {
quote!(rustc_errors::Applicability::Unspecified)
});
return Ok((span, applicability));
}
throw_span_err!(
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/filesearch.rs
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ pub fn get_or_default_sysroot() -> PathBuf {

// Check if sysroot is found using env::args().next(), and if is not found,
// use env::current_exe() to imply sysroot.
from_env_args_next().unwrap_or(from_current_exe())
from_env_args_next().unwrap_or_else(|| from_current_exe())
}

// The name of the directory rustc expects libraries to be located.
6 changes: 3 additions & 3 deletions compiler/rustc_typeck/src/check/writeback.rs
Original file line number Diff line number Diff line change
@@ -348,9 +348,9 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
let min_list_wb = min_list
.iter()
.map(|captured_place| {
let locatable = captured_place.info.path_expr_id.unwrap_or(
self.tcx().hir().local_def_id_to_hir_id(closure_def_id.expect_local()),
);
let locatable = captured_place.info.path_expr_id.unwrap_or_else(|| {
self.tcx().hir().local_def_id_to_hir_id(closure_def_id.expect_local())
});

self.resolve(captured_place.clone(), &locatable)
})