Skip to content

Rollup of 7 pull requests #139101

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

Merged
merged 18 commits into from
Mar 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
bf37447
Reject `{true,false}` as revision names
jieyouxu Mar 19, 2025
38cf49d
wasm: increase default thread stack size to 1 MB
surban Mar 20, 2025
a7bafc0
Change the syntax of the internal `weak!` macro
madsmtm Mar 26, 2025
a86e0da
doc(hir::Place): clarify that places aren't always place expressions
meithecatte Feb 26, 2025
376c88e
ExprUseVisitor: add clarifying doc comments
meithecatte Feb 26, 2025
aab1293
ExprUseVisitor: error -> bug in helper names
meithecatte Feb 26, 2025
f161953
ExprUseVisitor: remove leftover mentions of mem-categorization
meithecatte Feb 26, 2025
908504e
ExprUseVisitor: use tracing::instrument as appropriate
meithecatte Mar 26, 2025
827cb1b
use `try_fold` instead of `fold`
yotamofek Mar 28, 2025
9ef35dd
use `slice::contains` where applicable
yotamofek Mar 28, 2025
163ea4a
Add more tests for pin!().
m-ou-se Mar 28, 2025
240a4da
Rollup merge of #138692 - jieyouxu:reject-bool-lit-rev-names, r=wesle…
matthiaskrgr Mar 29, 2025
c82b88b
Rollup merge of #138757 - rust-wasi-web:wasi-thread-stack-size, r=ale…
matthiaskrgr Mar 29, 2025
111351f
Rollup merge of #138988 - madsmtm:internal-weak-macro-syntax, r=ibrah…
matthiaskrgr Mar 29, 2025
0e722cc
Rollup merge of #139056 - yotamofek:pr/smir/try_fold, r=scottmcm
matthiaskrgr Mar 29, 2025
b5ad69b
Rollup merge of #139057 - yotamofek:pr/slice-contains, r=wesleywiser
matthiaskrgr Mar 29, 2025
12165fc
Rollup merge of #139086 - meithecatte:expr-use-visitor-cleanup, r=com…
matthiaskrgr Mar 29, 2025
8b7088a
Rollup merge of #139097 - m-ou-se:pin-tests, r=WaffleLapkin
matthiaskrgr Mar 29, 2025
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
Prev Previous commit
Next Next commit
use slice::contains where applicable
  • Loading branch information
yotamofek committed Mar 28, 2025
commit 9ef35ddc0ca236db91d444a31de5fc8ac835ce9b
10 changes: 5 additions & 5 deletions compiler/rustc_builtin_macros/src/edition_panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ pub(crate) fn use_panic_2021(mut span: Span) -> bool {
// (To avoid using the edition of e.g. the assert!() or debug_assert!() definition.)
loop {
let expn = span.ctxt().outer_expn_data();
if let Some(features) = expn.allow_internal_unstable {
if features.iter().any(|&f| f == sym::edition_panic) {
span = expn.call_site;
continue;
}
if let Some(features) = expn.allow_internal_unstable
&& features.contains(&sym::edition_panic)
{
span = expn.call_site;
continue;
}
break expn.edition >= Edition::Edition2021;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,7 @@ fn msvc_imps_needed(tcx: TyCtxt<'_>) -> bool {
// indirectly from ThinLTO. In theory these are not needed as ThinLTO could resolve
// these, but it currently does not do so.
let can_have_static_objects =
tcx.sess.lto() == Lto::Thin || tcx.crate_types().iter().any(|ct| *ct == CrateType::Rlib);
tcx.sess.lto() == Lto::Thin || tcx.crate_types().contains(&CrateType::Rlib);

tcx.sess.target.is_like_windows &&
can_have_static_objects &&
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
if let Some((name, _)) = lang_items::extract(attrs)
&& let Some(lang_item) = LangItem::from_name(name)
{
if WEAK_LANG_ITEMS.iter().any(|&l| l == lang_item) {
if WEAK_LANG_ITEMS.contains(&lang_item) {
codegen_fn_attrs.flags |= CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL;
}
if let Some(link_name) = lang_item.link_name() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/builder/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ fn build_scope_drops<'tcx>(
// path, then don't generate the drop. (We only take this into
// account for non-unwind paths so as not to disturb the
// caching mechanism.)
if scope.moved_locals.iter().any(|&o| o == local) {
if scope.moved_locals.contains(&local) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct EntryContext<'tcx> {
}

fn entry_fn(tcx: TyCtxt<'_>, (): ()) -> Option<(DefId, EntryFnType)> {
let any_exe = tcx.crate_types().iter().any(|ty| *ty == CrateType::Executable);
let any_exe = tcx.crate_types().contains(&CrateType::Executable);
if !any_exe {
// No need to find a main function.
return None;
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_session/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ pub fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
arg[a.len()..].to_string()
};
let option = content.split_once('=').map(|s| s.0).unwrap_or(&content);
if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.iter().any(|exc| option == *exc) {
if ICE_REPORT_COMPILER_FLAGS_EXCLUDE.contains(&option) {
excluded_cargo_defaults = true;
} else {
result.push(a.to_string());
match ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.iter().find(|s| option == **s) {
Some(s) => result.push(format!("{s}=[REDACTED]")),
None => result.push(content),
}
result.push(if ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE.contains(&option) {
format!("{option}=[REDACTED]")
} else {
content
});
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ impl Span {
self.ctxt()
.outer_expn_data()
.allow_internal_unstable
.is_some_and(|features| features.iter().any(|&f| f == feature))
.is_some_and(|features| features.contains(&feature))
}

/// Checks if this span arises from a compiler desugaring of kind `kind`.
Expand Down
Loading