Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2b8de6f

Browse files
committed
Auto merge of rust-lang#87746 - JohnTitor:rollup-zaapqgl, r=JohnTitor
Rollup of 8 pull requests Successful merges: - rust-lang#81797 (Add `core::stream::from_iter`) - rust-lang#87267 (Remove space after negative sign in Literal to_string) - rust-lang#87663 (Rustdoc accessibility: use an icon for the [-]/[+] controls) - rust-lang#87720 (don't use .into() to convert types to identical types (clippy::useless_conversion)) - rust-lang#87723 (Use .contains instead of manual reimplementation.) - rust-lang#87729 (Remove the aarch64 `crypto` target_feature) - rust-lang#87731 (Update cargo) - rust-lang#87734 (Test dropping union fields more) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents a6ece56 + 7c5588e commit 2b8de6f

File tree

35 files changed

+375
-67
lines changed

35 files changed

+375
-67
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da"
255255

256256
[[package]]
257257
name = "cargo"
258-
version = "0.56.0"
258+
version = "0.57.0"
259259
dependencies = [
260260
"anyhow",
261261
"atty",
@@ -388,7 +388,7 @@ dependencies = [
388388

389389
[[package]]
390390
name = "cargo-util"
391-
version = "0.1.0"
391+
version = "0.1.1"
392392
dependencies = [
393393
"anyhow",
394394
"core-foundation",

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
4747
("sve", Some(sym::aarch64_target_feature)),
4848
// FEAT_CRC
4949
("crc", Some(sym::aarch64_target_feature)),
50-
// Cryptographic extension
51-
("crypto", Some(sym::aarch64_target_feature)),
5250
// FEAT_RAS
5351
("ras", Some(sym::aarch64_target_feature)),
5452
// FEAT_LSE

compiler/rustc_expand/src/proc_macro_server.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ impl server::Literal for Rustc<'_> {
582582

583583
Ok(Literal { lit, span: self.call_site })
584584
}
585+
fn to_string(&mut self, literal: &Self::Literal) -> String {
586+
literal.lit.to_string()
587+
}
585588
fn debug_kind(&mut self, literal: &Self::Literal) -> String {
586589
format!("{:?}", literal.lit.kind)
587590
}

compiler/rustc_mir/src/interpret/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
599599
let ptr = self.global_base_pointer(Pointer::new(id, offset))?;
600600
Operand::Indirect(MemPlace::from_ptr(ptr.into(), layout.align.abi))
601601
}
602-
ConstValue::Scalar(x) => Operand::Immediate(tag_scalar(x.into())?.into()),
602+
ConstValue::Scalar(x) => Operand::Immediate(tag_scalar(x)?.into()),
603603
ConstValue::Slice { data, start, end } => {
604604
// We rely on mutability being set correctly in `data` to prevent writes
605605
// where none should happen.

compiler/rustc_mir/src/interpret/terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
7373
ty::FnPtr(sig) => {
7474
let caller_abi = sig.abi();
7575
let fn_ptr = self.read_pointer(&func)?;
76-
let fn_val = self.memory.get_fn(fn_ptr.into())?;
76+
let fn_val = self.memory.get_fn(fn_ptr)?;
7777
(
7878
fn_val,
7979
caller_abi,

compiler/rustc_mir/src/transform/simplify_comparison_integral.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ fn find_branch_value_info<'tcx>(
211211
return None;
212212
};
213213
let branch_value_scalar = branch_value.literal.try_to_scalar()?;
214-
Some((branch_value_scalar.into(), branch_value_ty, *to_switch_on))
214+
Some((branch_value_scalar, branch_value_ty, *to_switch_on))
215215
}
216216
_ => None,
217217
}

library/core/src/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
847847
use self::ParseIntError as PIE;
848848

849849
assert!(
850-
radix >= 2 && radix <= 36,
850+
(2..=36).contains(&radix),
851851
"from_str_radix_int: must lie in the range `[2, 36]` - found {}",
852852
radix
853853
);

library/core/src/stream/from_iter.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
use crate::pin::Pin;
2+
3+
use crate::stream::Stream;
4+
use crate::task::{Context, Poll};
5+
6+
/// A stream that was created from iterator.
7+
///
8+
/// This stream is created by the [`from_iter`] function.
9+
/// See it documentation for more.
10+
///
11+
/// [`from_iter`]: fn.from_iter.html
12+
#[unstable(feature = "stream_from_iter", issue = "81798")]
13+
#[derive(Clone, Debug)]
14+
pub struct FromIter<I> {
15+
iter: I,
16+
}
17+
18+
#[unstable(feature = "stream_from_iter", issue = "81798")]
19+
impl<I> Unpin for FromIter<I> {}
20+
21+
/// Converts an iterator into a stream.
22+
#[unstable(feature = "stream_from_iter", issue = "81798")]
23+
pub fn from_iter<I: IntoIterator>(iter: I) -> FromIter<I::IntoIter> {
24+
FromIter { iter: iter.into_iter() }
25+
}
26+
27+
#[unstable(feature = "stream_from_iter", issue = "81798")]
28+
impl<I: Iterator> Stream for FromIter<I> {
29+
type Item = I::Item;
30+
31+
fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
32+
Poll::Ready(self.iter.next())
33+
}
34+
35+
fn size_hint(&self) -> (usize, Option<usize>) {
36+
self.iter.size_hint()
37+
}
38+
}

library/core/src/stream/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
//! warning: unused result that must be used: streams do nothing unless polled
123123
//! ```
124124
125+
mod from_iter;
125126
mod stream;
126127

128+
pub use from_iter::{from_iter, FromIter};
127129
pub use stream::Stream;

library/proc_macro/src/bridge/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ macro_rules! with_api {
109109
fn drop($self: $S::Literal);
110110
fn clone($self: &$S::Literal) -> $S::Literal;
111111
fn from_str(s: &str) -> Result<$S::Literal, ()>;
112+
fn to_string($self: &$S::Literal) -> String;
112113
fn debug_kind($self: &$S::Literal) -> String;
113114
fn symbol($self: &$S::Literal) -> String;
114115
fn suffix($self: &$S::Literal) -> Option<String>;

0 commit comments

Comments
 (0)