Fix typos
This commit is contained in:
parent
cd90d5c035
commit
5a6e995980
2 changed files with 4 additions and 4 deletions
|
@ -123,7 +123,7 @@ fn assert_ty_bounds(
|
|||
span: Span,
|
||||
assert_path: &[Symbol],
|
||||
) {
|
||||
// Deny anonymous structs or unions to avoid wierd errors.
|
||||
// Deny anonymous structs or unions to avoid weird errors.
|
||||
assert!(!ty.kind.is_anon_adt(), "Anonymous structs or unions cannot be type parameters");
|
||||
// Generate statement `let _: assert_path<ty>;`.
|
||||
let span = cx.with_def_site_ctxt(span);
|
||||
|
|
|
@ -316,7 +316,7 @@ fn make_format_args(
|
|||
|
||||
let mut used = vec![false; args.explicit_args().len()];
|
||||
let mut invalid_refs = Vec::new();
|
||||
let mut numeric_refences_to_named_arg = Vec::new();
|
||||
let mut numeric_references_to_named_arg = Vec::new();
|
||||
|
||||
enum ArgRef<'a> {
|
||||
Index(usize),
|
||||
|
@ -337,7 +337,7 @@ fn make_format_args(
|
|||
used[index] = true;
|
||||
if arg.kind.ident().is_some() {
|
||||
// This was a named argument, but it was used as a positional argument.
|
||||
numeric_refences_to_named_arg.push((index, span, used_as));
|
||||
numeric_references_to_named_arg.push((index, span, used_as));
|
||||
}
|
||||
Ok(index)
|
||||
} else {
|
||||
|
@ -545,7 +545,7 @@ fn make_format_args(
|
|||
// Only check for unused named argument names if there are no other errors to avoid causing
|
||||
// too much noise in output errors, such as when a named argument is entirely unused.
|
||||
if invalid_refs.is_empty() && !has_unused && !unnamed_arg_after_named_arg {
|
||||
for &(index, span, used_as) in &numeric_refences_to_named_arg {
|
||||
for &(index, span, used_as) in &numeric_references_to_named_arg {
|
||||
let (position_sp_to_replace, position_sp_for_msg) = match used_as {
|
||||
Placeholder(pspan) => (span, pspan),
|
||||
Precision => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue