Skip to content

Commit

Permalink
Auto merge of rust-lang#128439 - matthiaskrgr:rollup-m7ftgbi, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

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
  • Loading branch information
bors committed Jul 31, 2024
2 parents 99322d8 + 91869da commit b626d8c
Show file tree
Hide file tree
Showing 113 changed files with 5,610 additions and 1,133 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,10 @@ impl<'ll> CodegenCx<'ll, '_> {
ifn!("llvm.debugtrap", fn() -> void);
ifn!("llvm.frameaddress", fn(t_i32) -> ptr);

ifn!("llvm.powi.f16", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128", fn(t_f128, t_i32) -> t_f128);
ifn!("llvm.powi.f16.i32", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32.i32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64.i32", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128.i32", fn(t_f128, t_i32) -> t_f128);

ifn!("llvm.pow.f16", fn(t_f16, t_f16) -> t_f16);
ifn!("llvm.pow.f32", fn(t_f32, t_f32) -> t_f32);
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ fn get_simple_intrinsic<'ll>(
sym::sqrtf64 => "llvm.sqrt.f64",
sym::sqrtf128 => "llvm.sqrt.f128",

sym::powif16 => "llvm.powi.f16",
sym::powif32 => "llvm.powi.f32",
sym::powif64 => "llvm.powi.f64",
sym::powif128 => "llvm.powi.f128",
sym::powif16 => "llvm.powi.f16.i32",
sym::powif32 => "llvm.powi.f32.i32",
sym::powif64 => "llvm.powi.f64.i32",
sym::powif128 => "llvm.powi.f128.i32",

sym::sinf16 => "llvm.sin.f16",
sym::sinf32 => "llvm.sin.f32",
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,10 @@ lint_reason_must_be_string_literal = reason must be a string literal
lint_reason_must_come_last = reason in lint attribute must come last
lint_redundant_import = the item `{$ident}` is imported redundantly
.label_imported_here = the item `{ident}` is already imported here
.label_defined_here = the item `{ident}` is already defined here
.label_imported_prelude = the item `{ident}` is already imported by the extern prelude
.label_defined_prelude = the item `{ident}` is already defined by the extern prelude
.label_imported_here = the item `{$ident}` is already imported here
.label_defined_here = the item `{$ident}` is already defined here
.label_imported_prelude = the item `{$ident}` is already imported by the extern prelude
.label_defined_prelude = the item `{$ident}` is already defined by the extern prelude
lint_redundant_import_visibility = glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough
.note = the most public imported item is `{$max_vis}`
Expand Down
26 changes: 26 additions & 0 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ declare_lint_pass! {
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
PTR_CAST_ADD_AUTO_TO_OBJECT,
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
REDUNDANT_IMPORTS,
REDUNDANT_LIFETIMES,
REFINING_IMPL_TRAIT_INTERNAL,
REFINING_IMPL_TRAIT_REACHABLE,
Expand Down Expand Up @@ -426,6 +427,31 @@ declare_lint! {
"imports that are never used"
}

declare_lint! {
/// The `redundant_imports` lint detects imports that are redundant due to being
/// imported already; either through a previous import, or being present in
/// the prelude.
///
/// ### Example
///
/// ```rust,compile_fail
/// #![deny(redundant_imports)]
/// use std::option::Option::None;
/// fn foo() -> Option<i32> { None }
/// ```
///
/// {{produces}}
///
/// ### Explanation
///
/// Redundant imports are unnecessary and can be removed to simplify code.
/// If you intended to re-export the item to make it available outside of the
/// module, add a visibility modifier like `pub`.
pub REDUNDANT_IMPORTS,
Allow,
"imports that are redundant due to being imported already"
}

declare_lint! {
/// The `must_not_suspend` lint guards against values that shouldn't be held across suspend points
/// (`.await`)
Expand Down
Loading

0 comments on commit b626d8c

Please sign in to comment.