Skip to content

Commit 3d656f8

Browse files
authored
Merge pull request #780 from dtolnay/argref
Remove multiple arg lifetimes check
2 parents 5b97fc4 + 47b8209 commit 3d656f8

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

syntax/check.rs

-31
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,6 @@ fn check_api_fn(cx: &mut Check, efn: &ExternFn) {
469469
if efn.lang == Lang::Cxx {
470470
check_mut_return_restriction(cx, efn);
471471
}
472-
473-
check_multiple_arg_lifetimes(cx, efn);
474472
}
475473

476474
fn check_api_type_alias(cx: &mut Check, alias: &TypeAlias) {
@@ -564,35 +562,6 @@ fn check_mut_return_restriction(cx: &mut Check, efn: &ExternFn) {
564562
);
565563
}
566564

567-
fn check_multiple_arg_lifetimes(cx: &mut Check, efn: &ExternFn) {
568-
if efn.lang == Lang::Cxx && efn.trusted {
569-
return;
570-
}
571-
572-
match &efn.ret {
573-
Some(Type::Ref(_)) => {}
574-
_ => return,
575-
}
576-
577-
let mut reference_args = 0;
578-
for arg in &efn.args {
579-
if let Type::Ref(_) = &arg.ty {
580-
reference_args += 1;
581-
}
582-
}
583-
584-
if efn.receiver.is_some() {
585-
reference_args += 1;
586-
}
587-
588-
if reference_args != 1 {
589-
cx.error(
590-
efn,
591-
"functions that return a reference must take exactly one input reference",
592-
);
593-
}
594-
}
595-
596565
fn check_reserved_name(cx: &mut Check, ident: &Ident) {
597566
if ident == "Box"
598567
|| ident == "UniquePtr"

0 commit comments

Comments
 (0)