Skip to content

Commit b626d8c

Browse files
committed
Auto merge of rust-lang#128439 - matthiaskrgr:rollup-m7ftgbi, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#123813 (Add `REDUNDANT_IMPORTS` lint for new redundant import detection) - rust-lang#127159 (match lowering: Hide `Candidate` from outside the lowering algorithm) - rust-lang#128162 (Cleanup sys module to match house style) - rust-lang#128296 (Update target-spec metadata for loongarch64 targets) - rust-lang#128417 (Add `f16` and `f128` math functions) - rust-lang#128431 (Add myself as VxWorks target maintainer for reference) - rust-lang#128437 (improve bootstrap to allow selecting llvm tools individually) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 99322d8 + 91869da commit b626d8c

File tree

113 files changed

+5610
-1133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+5610
-1133
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,10 @@ impl<'ll> CodegenCx<'ll, '_> {
775775
ifn!("llvm.debugtrap", fn() -> void);
776776
ifn!("llvm.frameaddress", fn(t_i32) -> ptr);
777777

778-
ifn!("llvm.powi.f16", fn(t_f16, t_i32) -> t_f16);
779-
ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
780-
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
781-
ifn!("llvm.powi.f128", fn(t_f128, t_i32) -> t_f128);
778+
ifn!("llvm.powi.f16.i32", fn(t_f16, t_i32) -> t_f16);
779+
ifn!("llvm.powi.f32.i32", fn(t_f32, t_i32) -> t_f32);
780+
ifn!("llvm.powi.f64.i32", fn(t_f64, t_i32) -> t_f64);
781+
ifn!("llvm.powi.f128.i32", fn(t_f128, t_i32) -> t_f128);
782782

783783
ifn!("llvm.pow.f16", fn(t_f16, t_f16) -> t_f16);
784784
ifn!("llvm.pow.f32", fn(t_f32, t_f32) -> t_f32);

compiler/rustc_codegen_llvm/src/intrinsic.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ fn get_simple_intrinsic<'ll>(
3535
sym::sqrtf64 => "llvm.sqrt.f64",
3636
sym::sqrtf128 => "llvm.sqrt.f128",
3737

38-
sym::powif16 => "llvm.powi.f16",
39-
sym::powif32 => "llvm.powi.f32",
40-
sym::powif64 => "llvm.powi.f64",
41-
sym::powif128 => "llvm.powi.f128",
38+
sym::powif16 => "llvm.powi.f16.i32",
39+
sym::powif32 => "llvm.powi.f32.i32",
40+
sym::powif64 => "llvm.powi.f64.i32",
41+
sym::powif128 => "llvm.powi.f128.i32",
4242

4343
sym::sinf16 => "llvm.sin.f16",
4444
sym::sinf32 => "llvm.sin.f32",

compiler/rustc_lint/messages.ftl

+4-4
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,10 @@ lint_reason_must_be_string_literal = reason must be a string literal
700700
lint_reason_must_come_last = reason in lint attribute must come last
701701
702702
lint_redundant_import = the item `{$ident}` is imported redundantly
703-
.label_imported_here = the item `{ident}` is already imported here
704-
.label_defined_here = the item `{ident}` is already defined here
705-
.label_imported_prelude = the item `{ident}` is already imported by the extern prelude
706-
.label_defined_prelude = the item `{ident}` is already defined by the extern prelude
703+
.label_imported_here = the item `{$ident}` is already imported here
704+
.label_defined_here = the item `{$ident}` is already defined here
705+
.label_imported_prelude = the item `{$ident}` is already imported by the extern prelude
706+
.label_defined_prelude = the item `{$ident}` is already defined by the extern prelude
707707
708708
lint_redundant_import_visibility = glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough
709709
.note = the most public imported item is `{$max_vis}`

compiler/rustc_lint_defs/src/builtin.rs

+26
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ declare_lint_pass! {
8282
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
8383
PTR_CAST_ADD_AUTO_TO_OBJECT,
8484
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
85+
REDUNDANT_IMPORTS,
8586
REDUNDANT_LIFETIMES,
8687
REFINING_IMPL_TRAIT_INTERNAL,
8788
REFINING_IMPL_TRAIT_REACHABLE,
@@ -426,6 +427,31 @@ declare_lint! {
426427
"imports that are never used"
427428
}
428429

430+
declare_lint! {
431+
/// The `redundant_imports` lint detects imports that are redundant due to being
432+
/// imported already; either through a previous import, or being present in
433+
/// the prelude.
434+
///
435+
/// ### Example
436+
///
437+
/// ```rust,compile_fail
438+
/// #![deny(redundant_imports)]
439+
/// use std::option::Option::None;
440+
/// fn foo() -> Option<i32> { None }
441+
/// ```
442+
///
443+
/// {{produces}}
444+
///
445+
/// ### Explanation
446+
///
447+
/// Redundant imports are unnecessary and can be removed to simplify code.
448+
/// If you intended to re-export the item to make it available outside of the
449+
/// module, add a visibility modifier like `pub`.
450+
pub REDUNDANT_IMPORTS,
451+
Allow,
452+
"imports that are redundant due to being imported already"
453+
}
454+
429455
declare_lint! {
430456
/// The `must_not_suspend` lint guards against values that shouldn't be held across suspend points
431457
/// (`.await`)

0 commit comments

Comments
 (0)