Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #128454

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b4e1a53
Update target-spec metadata for loongarch64 targets
heiher Jul 28, 2024
9e05fb6
Small simplification
Nadrieril Jun 23, 2024
e2fd9aa
Set up false edges in `lower_match_tree`
Nadrieril Jun 23, 2024
cbdacec
Abstract out the candidate manipulation not in the main algorithm
Nadrieril Jun 23, 2024
c747166
Visiting bindings is straightforward now
Nadrieril Jun 23, 2024
08bcc01
Entirely hide `Candidate`s from outside `lower_match_tree`
Nadrieril Jun 30, 2024
689bb11
rewrite symbol-visibility to rmake
Oneirical Jun 27, 2024
dcaa17a
invalid stdout_utf8 handling in run_make_support
Oneirical Jul 15, 2024
7d7ad7b
android: Remove libstd hacks for unsupported Android APIs
maurer Jul 30, 2024
f6f587e
Introduce REDUNDANT_IMPORTS lint
compiler-errors Apr 11, 2024
eb0a444
Stabilize Wasm relaxed SIMD
daxpedda Feb 21, 2024
62d4998
Add VxWorks platfrom support documents
Jul 31, 2024
ea04b0a
use llvm-nm in symbol-visibility rmake test
Oneirical Jul 30, 2024
61d95e2
Implement a implicit target feature mechanism
daxpedda Jul 12, 2024
4ffdd2a
Rollup merge of #117468 - daxpedda:wasm-relaxed-simd, r=alexcrichton
tgross35 Jul 31, 2024
13cfcb2
Rollup merge of #123813 - compiler-errors:redundant-lint, r=petrochenkov
tgross35 Jul 31, 2024
f562771
Rollup merge of #127060 - Oneirical:testificate, r=jieyouxu
tgross35 Jul 31, 2024
8b050c1
Rollup merge of #127159 - Nadrieril:hide-candidate, r=matthewjasper
tgross35 Jul 31, 2024
8840f88
Rollup merge of #128296 - heiher:update-metadata, r=Urgau
tgross35 Jul 31, 2024
157d040
Rollup merge of #128416 - maurer:remove-android-hack, r=tgross35
tgross35 Jul 31, 2024
8fb0c91
Rollup merge of #128431 - biabbas:master, r=Urgau
tgross35 Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,22 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
}
}

// This is a workaround for a LLVM bug that doesn't implicitly enable
// `simd128` when `relaxed-simd` is.
// See <https://github.com/llvm/llvm-project/pull/99803>, which didn't make
// it into a released version of LLVM yet.
//
// This doesn't use the "implicit target feature" system because it is only
// used for function attributes in other targets, which fixes this bug as
// well on the function attribute level.
if sess.target.families.contains(&"wasm".into()) {
if features.iter().any(|f| f == "+relaxed-simd")
&& !features.iter().any(|f| f == "+simd128")
{
features.push("+simd128".into());
}
}

if diagnostics && let Some(f) = check_tied_features(sess, &featsmap) {
sess.dcx().emit_err(TargetFeatureDisableOrEnable {
features: f,
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ pub fn from_target_feature(
Some(Symbol::intern(feature))
}));
}

for (feature, requires) in tcx.sess.target.implicit_target_features() {
if target_features.iter().any(|f| f.as_str() == *feature)
&& !target_features.iter().any(|f| f.as_str() == *requires)
{
target_features.push(Symbol::intern(requires));
}
}
}

/// Computes the set of target features used in a function for the purposes of
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
Loading