Skip to content

Commit 81d8edc

Browse files
committed
Auto merge of rust-lang#137900 - matthiaskrgr:rollup-rvan5ao, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#137375 (Minor internal comments fix for `BufRead::read_line`) - rust-lang#137641 (More precisely document `Global::deallocate()`'s safety.) - rust-lang#137755 (doc: update Wasmtime flags) - rust-lang#137851 (improve `simd_select` error message when used with invalid mask type) - rust-lang#137860 (rustc_target: Add msync target feature and enable it on powerpcspe targets) - rust-lang#137871 (fix `RangeBounds::is_empty` documentation) - rust-lang#137873 (Disable `f16` on Aarch64 without `neon`) - rust-lang#137876 (Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`) - rust-lang#137883 (edit mailmap) - rust-lang#137886 (`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents daf5985 + 59fe0c7 commit 81d8edc

File tree

20 files changed

+158
-31
lines changed

20 files changed

+158
-31
lines changed

.mailmap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ James Hinshelwood <jameshinshelwood1@gmail.com> <james.hinshelwood@bigpayme.com>
292292
James Miller <bladeon@gmail.com> <james@aatch.net>
293293
James Perry <james.austin.perry@gmail.com>
294294
James Sanderson <zofrex@gmail.com>
295+
Jana Dönszelmann <jana@donsz.nl>
296+
Jana Dönszelmann <jana@donsz.nl> <jonathan@donsz.nl>
297+
Jana Dönszelmann <jana@donsz.nl> <jonabent@gmail.com>
295298
Jan-Erik Rediger <janerik@fnordig.de> <badboy@archlinux.us>
296299
Jaro Fietz <jaro.fietz@gmx.de>
297300
Jason Fager <jfager@gmail.com>

compiler/rustc_codegen_ssa/messages.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ codegen_ssa_invalid_monomorphization_inserted_type = invalid monomorphization of
119119
120120
codegen_ssa_invalid_monomorphization_invalid_bitmask = invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$mask_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]`
121121
122-
codegen_ssa_invalid_monomorphization_mask_type = invalid monomorphization of `{$name}` intrinsic: mask element type is `{$ty}`, expected `i_`
122+
codegen_ssa_invalid_monomorphization_mask_type = invalid monomorphization of `{$name}` intrinsic: found mask element type is `{$ty}`, expected a signed integer type
123+
.note = the mask may be widened, which only has the correct behavior for signed integers
123124
124125
codegen_ssa_invalid_monomorphization_mismatched_lengths = invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}`
125126

compiler/rustc_codegen_ssa/src/errors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ pub enum InvalidMonomorphization<'tcx> {
957957
},
958958

959959
#[diag(codegen_ssa_invalid_monomorphization_mask_type, code = E0511)]
960+
#[note]
960961
MaskType {
961962
#[primary_span]
962963
span: Span,

compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub(crate) fn target() -> Target {
2424
options: TargetOptions {
2525
abi: "spe".into(),
2626
endian: Endian::Big,
27-
features: "+secure-plt".into(),
27+
features: "+secure-plt,+msync".into(),
2828
mcount: "_mcount".into(),
2929
..base
3030
},

compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub(crate) fn target() -> Target {
2626
options: TargetOptions {
2727
abi: "spe".into(),
2828
endian: Endian::Big,
29+
features: "+msync".into(),
2930
mcount: "_mcount".into(),
3031
..base
3132
},

compiler/rustc_target/src/target_features.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ const HEXAGON_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
461461
static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
462462
// tidy-alphabetical-start
463463
("altivec", Unstable(sym::powerpc_target_feature), &[]),
464+
("msync", Unstable(sym::powerpc_target_feature), &[]),
464465
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
465466
("power10-vector", Unstable(sym::powerpc_target_feature), &["power9-vector"]),
466467
("power8-altivec", Unstable(sym::powerpc_target_feature), &["altivec"]),

compiler/stable_mir/src/crate_def.rs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ use crate::{Crate, Symbol, with};
1010
#[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize)]
1111
pub struct DefId(pub(crate) usize);
1212

13+
impl DefId {
14+
/// Return fully qualified name of this definition
15+
pub fn name(&self) -> Symbol {
16+
with(|cx| cx.def_name(*self, false))
17+
}
18+
19+
/// Return a trimmed name of this definition.
20+
///
21+
/// This can be used to print more user friendly diagnostic messages.
22+
///
23+
/// If a symbol name can only be imported from one place for a type, and as
24+
/// long as it was not glob-imported anywhere in the current crate, we trim its
25+
/// path and print only the name.
26+
///
27+
/// For example, this function may shorten `std::vec::Vec` to just `Vec`,
28+
/// as long as there is no other `Vec` importable anywhere.
29+
pub fn trimmed_name(&self) -> Symbol {
30+
with(|cx| cx.def_name(*self, true))
31+
}
32+
}
33+
1334
/// A trait for retrieving information about a particular definition.
1435
///
1536
/// Implementors must provide the implementation of `def_id` which will be used to retrieve
@@ -19,24 +40,17 @@ pub trait CrateDef {
1940
fn def_id(&self) -> DefId;
2041

2142
/// Return the fully qualified name of the current definition.
43+
///
44+
/// See [`DefId::name`] for more details
2245
fn name(&self) -> Symbol {
23-
let def_id = self.def_id();
24-
with(|cx| cx.def_name(def_id, false))
46+
self.def_id().name()
2547
}
2648

2749
/// Return a trimmed name of this definition.
2850
///
29-
/// This can be used to print more user friendly diagnostic messages.
30-
///
31-
/// If a symbol name can only be imported from one place for a type, and as
32-
/// long as it was not glob-imported anywhere in the current crate, we trim its
33-
/// path and print only the name.
34-
///
35-
/// For example, this function may shorten `std::vec::Vec` to just `Vec`,
36-
/// as long as there is no other `Vec` importable anywhere.
51+
/// See [`DefId::trimmed_name`] for more details
3752
fn trimmed_name(&self) -> Symbol {
38-
let def_id = self.def_id();
39-
with(|cx| cx.def_name(def_id, true))
53+
self.def_id().trimmed_name()
4054
}
4155

4256
/// Return information about the crate where this definition is declared.

compiler/stable_mir/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ pub type CrateNum = usize;
4848

4949
impl Debug for DefId {
5050
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
51-
f.debug_struct("DefId")
52-
.field("id", &self.0)
53-
.field("name", &with(|cx| cx.def_name(*self, false)))
54-
.finish()
51+
f.debug_struct("DefId").field("id", &self.0).field("name", &self.name()).finish()
5552
}
5653
}
5754

library/alloc/src/alloc.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,14 @@ unsafe impl Allocator for Global {
264264
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
265265
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
266266
if layout.size() != 0 {
267-
// SAFETY: `layout` is non-zero in size,
268-
// other conditions must be upheld by the caller
267+
// SAFETY:
268+
// * We have checked that `layout` is non-zero in size.
269+
// * The caller is obligated to provide a layout that "fits", and in this case,
270+
// "fit" always means a layout that is equal to the original, because our
271+
// `allocate()`, `grow()`, and `shrink()` implementations never returns a larger
272+
// allocation than requested.
273+
// * Other conditions must be upheld by the caller, as per `Allocator::deallocate()`'s
274+
// safety documentation.
269275
unsafe { dealloc(ptr.as_ptr(), layout) }
270276
}
271277
}

library/core/src/ops/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ pub trait RangeBounds<T: ?Sized> {
827827
}
828828

829829
/// Returns `true` if the range contains no items.
830-
/// One-sided ranges (`RangeFrom`, etc) always return `true`.
830+
/// One-sided ranges (`RangeFrom`, etc) always return `false`.
831831
///
832832
/// # Examples
833833
///

0 commit comments

Comments
 (0)