Skip to content

Commit 8e94318

Browse files
committed
rename
1 parent c499a24 commit 8e94318

40 files changed

+87
-91
lines changed

compiler/rustc_codegen_cranelift/example/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(no_core, unboxed_closures)]
22
#![no_core]
3-
#![allow(dead_code, unnecessary_transmutate)]
3+
#![allow(dead_code, unnecessary_transmutes)]
44

55
extern crate mini_core;
66

compiler/rustc_codegen_gcc/example/example.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(no_core, unboxed_closures)]
22
#![no_core]
3-
#![allow(dead_code, unnecessary_transmutate)]
3+
#![allow(dead_code, unnecessary_transmutes)]
44

55
extern crate mini_core;
66

@@ -11,11 +11,7 @@ fn abc(a: u8) -> u8 {
1111
}
1212

1313
fn bcd(b: bool, a: u8) -> u8 {
14-
if b {
15-
a * 2
16-
} else {
17-
a * 3
18-
}
14+
if b { a * 2 } else { a * 3 }
1915
}
2016

2117
fn call() {

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ declare_lint_pass! {
119119
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
120120
UNNAMEABLE_TEST_ITEMS,
121121
UNNAMEABLE_TYPES,
122-
UNNECESSARY_TRANSMUTATE,
122+
UNNECESSARY_TRANSMUTES,
123123
UNREACHABLE_CODE,
124124
UNREACHABLE_PATTERNS,
125125
UNSAFE_ATTR_OUTSIDE_UNSAFE,
@@ -4945,7 +4945,7 @@ declare_lint! {
49454945
}
49464946

49474947
declare_lint! {
4948-
/// The `unnecessary_transmutate` lint detects transmutations that have safer alternatives.
4948+
/// The `unnecessary_transmutes` lint detects transmutations that have safer alternatives.
49494949
///
49504950
/// ### Example
49514951
///
@@ -4963,7 +4963,7 @@ declare_lint! {
49634963
/// [`transmute`](https://doc.rust-lang.org/std/mem/fn.transmute.html) as
49644964
/// they more clearly communicate the intent, are easier to review, and
49654965
/// are less likely to accidentally result in unsoundness.
4966-
pub UNNECESSARY_TRANSMUTATE,
4966+
pub UNNECESSARY_TRANSMUTES,
49674967
Warn,
49684968
"detects transmutes that are shadowed by std methods"
49694969
}

compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_middle::mir::visit::Visitor;
22
use rustc_middle::mir::{Body, Location, Operand, Terminator, TerminatorKind};
33
use rustc_middle::ty::*;
4-
use rustc_session::lint::builtin::UNNECESSARY_TRANSMUTATE;
4+
use rustc_session::lint::builtin::UNNECESSARY_TRANSMUTES;
55
use rustc_span::source_map::Spanned;
66
use rustc_span::{Span, sym};
77

@@ -24,7 +24,7 @@ struct UnnecessaryTransmuteChecker<'a, 'tcx> {
2424
}
2525

2626
impl<'a, 'tcx> UnnecessaryTransmuteChecker<'a, 'tcx> {
27-
fn is_redundant_transmute(
27+
fn is_unnecessary_transmute(
2828
&self,
2929
function: &Operand<'tcx>,
3030
arg: String,
@@ -87,14 +87,14 @@ impl<'tcx> Visitor<'tcx> for UnnecessaryTransmuteChecker<'_, 'tcx> {
8787
&& let Some((func_def_id, _)) = func.const_fn_def()
8888
&& self.tcx.is_intrinsic(func_def_id, sym::transmute)
8989
&& let span = self.body.source_info(location).span
90-
&& let Some(lint) = self.is_redundant_transmute(
90+
&& let Some(lint) = self.is_unnecessary_transmute(
9191
func,
9292
self.tcx.sess.source_map().span_to_snippet(arg).expect("ok"),
9393
span,
9494
)
9595
&& let Some(hir_id) = terminator.source_info.scope.lint_root(&self.body.source_scopes)
9696
{
97-
self.tcx.emit_node_span_lint(UNNECESSARY_TRANSMUTATE, hir_id, span, lint);
97+
self.tcx.emit_node_span_lint(UNNECESSARY_TRANSMUTES, hir_id, span, lint);
9898
}
9999
}
100100
}

library/alloctests/tests/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![deny(warnings)]
22
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
33
#![allow(static_mut_refs)]
4-
#![cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
4+
#![cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
55

66
use std::cell::RefCell;
77
use std::fmt::{self, Write};

library/core/src/char/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(super) const fn from_u32(i: u32) -> Option<char> {
2121
/// Converts a `u32` to a `char`, ignoring validity. See [`char::from_u32_unchecked`].
2222
#[inline]
2323
#[must_use]
24-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
24+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
2525
pub(super) const unsafe fn from_u32_unchecked(i: u32) -> char {
2626
// SAFETY: the caller must guarantee that `i` is a valid char value.
2727
unsafe {
@@ -222,7 +222,7 @@ impl FromStr for char {
222222
}
223223

224224
#[inline]
225-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
225+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
226226
const fn char_try_from_u32(i: u32) -> Result<char, CharTryFromError> {
227227
// This is an optimized version of the check
228228
// (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF),

library/core/src/intrinsics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ pub const fn forget<T: ?Sized>(_: T);
14981498
/// Turning raw bytes (`[u8; SZ]`) into `u32`, `f64`, etc.:
14991499
///
15001500
/// ```
1501-
/// # #![cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
1501+
/// # #![cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
15021502
/// let raw_bytes = [0x78, 0x56, 0x34, 0x12];
15031503
///
15041504
/// let num = unsafe {

library/core/src/num/f128.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ impl f128 {
898898
#[inline]
899899
#[unstable(feature = "f128", issue = "116909")]
900900
#[must_use = "this returns the result of the operation, without modifying the original"]
901-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
901+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
902902
pub const fn to_bits(self) -> u128 {
903903
// SAFETY: `u128` is a plain old datatype so we can always transmute to it.
904904
unsafe { mem::transmute(self) }
@@ -946,7 +946,7 @@ impl f128 {
946946
#[inline]
947947
#[must_use]
948948
#[unstable(feature = "f128", issue = "116909")]
949-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
949+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
950950
pub const fn from_bits(v: u128) -> Self {
951951
// It turns out the safety issues with sNaN were overblown! Hooray!
952952
// SAFETY: `u128` is a plain old datatype so we can always transmute from it.

library/core/src/num/f16.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ impl f16 {
886886
#[inline]
887887
#[unstable(feature = "f16", issue = "116909")]
888888
#[must_use = "this returns the result of the operation, without modifying the original"]
889-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
889+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
890890
pub const fn to_bits(self) -> u16 {
891891
// SAFETY: `u16` is a plain old datatype so we can always transmute to it.
892892
unsafe { mem::transmute(self) }
@@ -933,7 +933,7 @@ impl f16 {
933933
#[inline]
934934
#[must_use]
935935
#[unstable(feature = "f16", issue = "116909")]
936-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
936+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
937937
pub const fn from_bits(v: u16) -> Self {
938938
// It turns out the safety issues with sNaN were overblown! Hooray!
939939
// SAFETY: `u16` is a plain old datatype so we can always transmute from it.

library/core/src/num/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ impl f32 {
10891089
#[stable(feature = "float_bits_conv", since = "1.20.0")]
10901090
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
10911091
#[inline]
1092-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
1092+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
10931093
pub const fn to_bits(self) -> u32 {
10941094
// SAFETY: `u32` is a plain old datatype so we can always transmute to it.
10951095
unsafe { mem::transmute(self) }
@@ -1135,7 +1135,7 @@ impl f32 {
11351135
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
11361136
#[must_use]
11371137
#[inline]
1138-
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutate))]
1138+
#[cfg_attr(not(bootstrap), allow(unnecessary_transmutes))]
11391139
pub const fn from_bits(v: u32) -> Self {
11401140
// It turns out the safety issues with sNaN were overblown! Hooray!
11411141
// SAFETY: `u32` is a plain old datatype so we can always transmute from it.

0 commit comments

Comments
 (0)