mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Revert "fixup warnings around the compiler"
This reverts commit f20175293a.
This commit is contained in:
@@ -86,8 +86,7 @@ fn get_dylib_metadata(&self, target: &Target, path: &Path) -> Result<OwnedSlice,
|
||||
format!("failed to parse aix dylib '{}': {}", path.display(), e)
|
||||
})?;
|
||||
|
||||
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
|
||||
match Itertools::exactly_one(archive.members()) {
|
||||
match archive.members().exactly_one() {
|
||||
Ok(lib) => {
|
||||
let lib = lib.map_err(|e| {
|
||||
format!("failed to parse aix dylib '{}': {}", path.display(), e)
|
||||
|
||||
@@ -1126,8 +1126,7 @@ pub(crate) fn print_impl(
|
||||
}
|
||||
if impl_.kind.is_fake_variadic()
|
||||
&& let Some(generics) = ty.generics()
|
||||
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
|
||||
&& let Ok(inner_type) = Itertools::exactly_one(generics)
|
||||
&& let Ok(inner_type) = generics.exactly_one()
|
||||
{
|
||||
let last = ty.last();
|
||||
if f.alternate() {
|
||||
@@ -1207,8 +1206,7 @@ fn print_type(
|
||||
}
|
||||
} else if let clean::Type::Path { path } = type_
|
||||
&& let Some(generics) = path.generics()
|
||||
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
|
||||
&& let Ok(ty) = Itertools::exactly_one(generics)
|
||||
&& let Ok(ty) = generics.exactly_one()
|
||||
&& self.kind.is_fake_variadic()
|
||||
{
|
||||
print_anchor(path.def_id(), path.last(), cx).fmt(f)?;
|
||||
|
||||
@@ -92,8 +92,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
|
||||
(matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id)))
|
||||
.then_some((v.def_id, v.span))
|
||||
});
|
||||
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
|
||||
if let Ok((id, span)) = Itertools::exactly_one(iter)
|
||||
if let Ok((id, span)) = iter.exactly_one()
|
||||
&& !find_attr!(cx.tcx.hir_attrs(item.hir_id()), AttributeKind::NonExhaustive(..))
|
||||
{
|
||||
self.potential_enums.push((item.owner_id.def_id, id, item.span, span));
|
||||
@@ -105,8 +104,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
|
||||
.iter()
|
||||
.filter(|field| !cx.effective_visibilities.is_exported(field.def_id));
|
||||
if fields.len() > 1
|
||||
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
|
||||
&& let Ok(field) = Itertools::exactly_one(private_fields)
|
||||
&& let Ok(field) = private_fields.exactly_one()
|
||||
&& let TyKind::Tup([]) = field.ty.kind
|
||||
{
|
||||
span_lint_and_then(
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
trait CollectSlice<'a>: Iterator {
|
||||
fn inner_array<const N: usize>(&mut self) -> [Self::Item; N];
|
||||
|
||||
fn custom_collect_array<const N: usize>(&mut self) -> [Self::Item; N] {
|
||||
fn collect_array<const N: usize>(&mut self) -> [Self::Item; N] {
|
||||
let result = self.inner_array();
|
||||
assert!(self.next().is_none());
|
||||
result
|
||||
@@ -34,5 +34,5 @@ impl<'a, I: ?Sized> CollectSlice<'a> for I
|
||||
|
||||
fn main() {
|
||||
let mut foos = [0u64; 9].iter().cloned();
|
||||
let _bar: [u64; 9] = foos.custom_collect_array::<9_usize>();
|
||||
let _bar: [u64; 9] = foos.collect_array::<9_usize>();
|
||||
}
|
||||
|
||||
@@ -29,11 +29,10 @@ impl<A, I: ?Sized> CollectArray<A> for I
|
||||
|
||||
fn main() {
|
||||
assert_eq!(
|
||||
CollectArray::collect_array(
|
||||
&mut [[1, 2], [3, 4]]
|
||||
[[1, 2], [3, 4]]
|
||||
.iter()
|
||||
.map(|row| CollectArray::collect_array(&mut row.iter()))
|
||||
),
|
||||
.map(|row| row.iter().collect_array())
|
||||
.collect_array(),
|
||||
[[&1, &2], [&3, &4]]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user