Skip to content

Rollup of 10 pull requests #69555

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 32 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
81e4027
Update RELEASES.md for 1.42.0
XAMPPRocky Feb 9, 2020
26fdcbb
Update RELEASES.md
XAMPPRocky Feb 9, 2020
7ab01b2
Update RELEASES.md
XAMPPRocky Feb 10, 2020
32daa2a
Update RELEASES.md
XAMPPRocky Feb 10, 2020
e7a344f
Update RELEASES.md
XAMPPRocky Feb 23, 2020
59261f0
Add some missing support for `NtIdent`
petrochenkov Feb 22, 2020
b2605c1
parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`
petrochenkov Feb 24, 2020
9b6e0e8
simplify check_pat_lit
Centril Feb 25, 2020
5da3a2f
enhance check_pat_lit with TopInfo
Centril Feb 25, 2020
e58496c
improve ParentHirIterator discoverability
Centril Feb 25, 2020
1d33717
improve or-pattern type consistency diagnostics
Centril Feb 25, 2020
e9f6bb7
check_pat_path: use pattern_cause
Centril Feb 25, 2020
b1de8f1
check_pat_tuple: use pattern_cause
Centril Feb 25, 2020
d234e13
check_pat_ref: use pattern_cause
Centril Feb 25, 2020
6672a04
instantiate_value_path: .impl_self_ty -> .type_of
Centril Feb 21, 2020
526280a
Merge branch 'master' into relnotes-1.42.0
XAMPPRocky Feb 26, 2020
7c84ba1
use char instead of &str for single char patterns
matthiaskrgr Feb 26, 2020
c1de0b1
Remove unneeded calls to format!()
dotdash Feb 27, 2020
13d42f4
error_derive_forbidden_on_non_adt: be more graceful
Centril Feb 27, 2020
4e0bea3
Stabilize `boxed_slice_try_from`
JohnTitor Feb 28, 2020
85b585d
late resolve, visit_fn: bail early if there's no body.
Centril Feb 28, 2020
ff9341a
remove redundant clones, references to operands, explicit boolean com…
matthiaskrgr Feb 28, 2020
bbf6eec
Rollup merge of #68989 - XAMPPRocky:relnotes-1.42.0, r=Mark-Simulacrum
Centril Feb 28, 2020
76fe449
Rollup merge of #69340 - Centril:self-ctor-normalize, r=nikomatsakis
Centril Feb 28, 2020
3828fa2
Rollup merge of #69384 - petrochenkov:nounnorm, r=Centril
Centril Feb 28, 2020
a245221
Rollup merge of #69452 - Centril:typeck-pat, r=estebank
Centril Feb 28, 2020
07d9ed2
Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morse
Centril Feb 28, 2020
87cc521
Rollup merge of #69522 - Centril:fix-69341, r=petrochenkov
Centril Feb 28, 2020
e4cedc9
Rollup merge of #69538 - JohnTitor:boxed-slice-try-from, r=Centril
Centril Feb 28, 2020
b95945c
Rollup merge of #69539 - Centril:fix-69401, r=petrochenkov
Centril Feb 28, 2020
61b091b
Rollup merge of #69541 - dotdash:format, r=Mark-Simulacrum
Centril Feb 28, 2020
13e4c6c
Rollup merge of #69547 - matthiaskrgr:more_misc, r=Mark-Simulacrum
Centril Feb 28, 2020
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
Remove unneeded calls to format!()
  • Loading branch information
dotdash committed Feb 27, 2020
commit c1de0b1b70cfb58cec5d35d0cd790e51618c6d53
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl RustcDefaultCalls {
});
compiler.codegen_backend().link(&sess, Box::new(codegen_results), &outputs)
} else {
sess.fatal(&format!("rlink must be a file"))
sess.fatal("rlink must be a file")
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/librustc_expand/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1664,10 +1664,9 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
}
}
} else {
let mut err = self.cx.struct_span_err(
it.span(),
&format!("expected path to external documentation"),
);
let mut err = self
.cx
.struct_span_err(it.span(), "expected path to external documentation");

// Check if the user erroneously used `doc(include(...))` syntax.
let literal = it.meta_item_list().and_then(|list| {
Expand Down
5 changes: 1 addition & 4 deletions src/librustc_incremental/assert_module_sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ impl AssertModuleSource<'tcx> {
if !self.tcx.sess.opts.debugging_opts.query_dep_graph {
self.tcx.sess.span_fatal(
attr.span,
&format!(
"found CGU-reuse attribute but `-Zquery-dep-graph` \
was not specified"
),
"found CGU-reuse attribute but `-Zquery-dep-graph` was not specified",
);
}

Expand Down
5 changes: 1 addition & 4 deletions src/librustc_incremental/persist/dirty_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,7 @@ impl FindAllAttrs<'tcx> {
if !checked_attrs.contains(&attr.id) {
self.tcx.sess.span_err(
attr.span,
&format!(
"found unchecked \
`#[rustc_dirty]` / `#[rustc_clean]` attribute"
),
"found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute",
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_infer/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ pub struct OverlapResult<'tcx> {
}

pub fn add_placeholder_note(err: &mut rustc_errors::DiagnosticBuilder<'_>) {
err.note(&format!(
err.note(
"this behavior recently changed as a result of a bug fix; \
see rust-lang/rust#56105 for details"
));
see rust-lang/rust#56105 for details",
);
}

/// If there are types that satisfy both impls, invokes `on_overlap`
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_infer/traits/error_reporting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {

// Already reported in the query.
ConstEvalFailure(ErrorHandled::Reported) => {
self.tcx
.sess
.delay_span_bug(span, &format!("constant in type had an ignored error"));
self.tcx.sess.delay_span_bug(span, "constant in type had an ignored error");
return;
}

Expand Down
5 changes: 1 addition & 4 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ impl<'a> CrateLoader<'a> {

// Sanity check the loaded crate to ensure it is indeed a profiler runtime
if !data.is_profiler_runtime() {
self.sess.err(&format!(
"the crate `profiler_builtins` is not \
a profiler runtime"
));
self.sess.err("the crate `profiler_builtins` is not a profiler runtime");
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_mir/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ impl NonConstOp for Downcast {
pub struct FnCallIndirect;
impl NonConstOp for FnCallIndirect {
fn emit_error(&self, item: &Item<'_, '_>, span: Span) {
let mut err = item
.tcx
.sess
.struct_span_err(span, &format!("function pointers are not allowed in const fn"));
let mut err =
item.tcx.sess.struct_span_err(span, "function pointers are not allowed in const fn");
err.emit();
}
}
Expand Down
15 changes: 6 additions & 9 deletions src/librustc_parse/parser/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,12 @@ impl<'a> Parser<'a> {
.span_label(attrs[0].span, "attributes must go before parameters")
.emit();
} else {
self.struct_span_err(
attrs[0].span,
&format!("attribute without generic parameters"),
)
.span_label(
attrs[0].span,
"attributes are only permitted when preceding parameters",
)
.emit();
self.struct_span_err(attrs[0].span, "attribute without generic parameters")
.span_label(
attrs[0].span,
"attributes are only permitted when preceding parameters",
)
.emit();
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_passes/weak_lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ fn verify<'tcx>(tcx: TyCtxt<'tcx>, items: &lang_items::LanguageItems) {
for (name, &item) in WEAK_ITEMS_REFS.iter() {
if missing.contains(&item) && !whitelisted(tcx, item) && items.require(item).is_err() {
if item == lang_items::PanicImplLangItem {
tcx.sess.err(&format!("`#[panic_handler]` function required, but not found"));
tcx.sess.err("`#[panic_handler]` function required, but not found");
} else if item == lang_items::OomLangItem {
tcx.sess.err(&format!("`#[alloc_error_handler]` function required, but not found"));
tcx.sess.err("`#[alloc_error_handler]` function required, but not found");
} else {
tcx.sess.err(&format!("language item required, but not found: `{}`", name));
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl<'a> Resolver<'a> {
if has_generic_params == HasGenericParams::Yes {
// Try to retrieve the span of the function signature and generate a new
// message with a local type or const parameter.
let sugg_msg = &format!("try using a local generic parameter instead");
let sugg_msg = "try using a local generic parameter instead";
if let Some((sugg_span, snippet)) = sm.generate_local_type_param_snippet(span) {
// Suggest the modification to the user
err.span_suggestion(
Expand All @@ -194,7 +194,7 @@ impl<'a> Resolver<'a> {
format!("try adding a local generic parameter in this method instead"),
);
} else {
err.help(&format!("try using a local generic parameter instead"));
err.help("try using a local generic parameter instead");
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/librustc_session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,10 +1500,8 @@ fn parse_libs(
{
early_error(
error_format,
&format!(
"the library kind 'static-nobundle' is only \
accepted on the nightly compiler"
),
"the library kind 'static-nobundle' is only \
accepted on the nightly compiler",
);
}
let mut name_parts = name.splitn(2, ':');
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
),
);
}
err.note(&format!(
err.note(
"because of the default `Self` reference, type parameters must be \
specified on object types"
));
specified on object types",
);
err.emit();
}

Expand Down
6 changes: 3 additions & 3 deletions src/librustc_typeck/coherence/inherent_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ impl ItemLikeVisitor<'v> for InherentCollect<'tcx> {
"no base type found for inherent implementation"
)
.span_label(ty.span, "impl requires a base type")
.note(&format!(
.note(
"either implement a trait on it or create a newtype \
to wrap it instead"
))
to wrap it instead",
)
.emit();
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,10 +1282,10 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
param.hir_id,
param.span,
|lint| {
lint.build(&format!(
lint.build(
"defaults for type parameters are only allowed in \
`struct`, `enum`, `type`, or `trait` definitions."
))
`struct`, `enum`, `type`, or `trait` definitions.",
)
.emit();
},
);
Expand Down