Skip to content

Rollup of 11 pull requests #136378

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b20bc53
ci: fix explanation why LLVM download is disabled for windows-gnu
mati865 Nov 20, 2024
56c6ffb
Use +secure-plt for powerpc-unknown-linux-gnu{,spe}
taiki-e Jan 27, 2025
139d6ba
set rustc dylib on manually constructed rustc command
onur-ozkan Jan 30, 2025
4d42046
CompileTest: Add Directives to Ignore `arm-unknown-*` Tests
veera-sivarajan Jan 31, 2025
56795fb
Add amdgpu target
Flakebi Jan 2, 2025
860476f
Update encode_utf16 to mention it is native endian
hkBst Jan 30, 2025
88260f4
bootstrap: only build `crt{begin,end}.o` when compiling to MUSL
japaric Jan 21, 2025
2c35bd0
`#[optimize(none)]` implies `#[inline(never)]`
clubby789 Jan 31, 2025
8e9422f
Make comma separated lists of anything easier to make for errors
estebank Jan 31, 2025
0751e90
Rework "long type names" printing logic
estebank Jan 31, 2025
24cdaa1
Rename `tcx.ensure()` to `tcx.ensure_ok()`
Zalathar Jan 30, 2025
9e4f10d
Rename `tcx.ensure_with_value()` to `tcx.ensure_done()`
Zalathar Jan 30, 2025
fef46f4
Rename `ensure_forwards_result_if_red` to `return_result_from_ensure_ok`
Zalathar Jan 30, 2025
3581512
Use an explicit type when discarding the result of `tcx.ensure_ok()`
Zalathar Jan 30, 2025
3ae0239
Mark the tcx-ensure wrapper types with `#[must_use]`
Zalathar Jan 30, 2025
01bf470
Rollup merge of #133266 - mati865:windows-gnu-llvm-download, r=Kobzol
jhpratt Feb 1, 2025
9931624
Rollup merge of #134740 - Flakebi:amdgpu-target, r=workingjubilee
jhpratt Feb 1, 2025
dcde19f
Rollup merge of #135836 - ferrocene:ja-gh135782-build-crt-only-for-mu…
jhpratt Feb 1, 2025
72af398
Rollup merge of #136154 - taiki-e:ppc-secure-plt, r=nikic
jhpratt Feb 1, 2025
5cbd797
Rollup merge of #136279 - Zalathar:ensure-ok, r=oli-obk
jhpratt Feb 1, 2025
993feb0
Rollup merge of #136283 - hkBst:patch-31, r=workingjubilee
jhpratt Feb 1, 2025
d5525f5
Rollup merge of #136309 - onur-ozkan:133629, r=jieyouxu
jhpratt Feb 1, 2025
a75511a
Rollup merge of #136328 - estebank:long-ty-path, r=jieyouxu,lqd
jhpratt Feb 1, 2025
c975c1f
Rollup merge of #136339 - veera-sivarajan:ignore-arm-unknown-headers,…
jhpratt Feb 1, 2025
dd685de
Rollup merge of #136358 - clubby789:opt-none-noinline, r=saethlin
jhpratt Feb 1, 2025
d34b025
Rollup merge of #136368 - estebank:listify, r=fee1-dead
jhpratt Feb 1, 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
Rename tcx.ensure() to tcx.ensure_ok()
  • Loading branch information
Zalathar committed Feb 1, 2025
commit 24cdaa146a166e679cbc3fc5187315b043090af2
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ pub(crate) fn run_aot(

if tcx.dep_graph.is_fully_enabled() {
for cgu in cgus {
tcx.ensure().codegen_unit(cgu.name());
tcx.ensure_ok().codegen_unit(cgu.name());
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
// unnecessarily.
if tcx.dep_graph.is_fully_enabled() {
for cgu in codegen_units {
tcx.ensure().codegen_unit(cgu.name());
tcx.ensure_ok().codegen_unit(cgu.name());
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
if let Some(pp_mode) = sess.opts.pretty {
if pp_mode.needs_ast_map() {
create_and_enter_global_ctxt(compiler, krate, |tcx| {
tcx.ensure().early_lint_checks(());
tcx.ensure_ok().early_lint_checks(());
pretty::print(sess, pp_mode, pretty::PrintExtra::NeedsAstMap { tcx });
passes::write_dep_info(tcx);
});
Expand Down Expand Up @@ -365,7 +365,7 @@ pub fn run_compiler(at_args: &[String], callbacks: &mut (dyn Callbacks + Send))
return early_exit();
}

tcx.ensure().analysis(());
tcx.ensure_ok().analysis(());

if callbacks.after_analysis(compiler, tcx) == Compilation::Stop {
return early_exit();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_driver_impl/src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl<'tcx> PrintExtra<'tcx> {

pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
if ppm.needs_analysis() {
ex.tcx().ensure().analysis(());
ex.tcx().ensure_ok().analysis(());
}

let (src, src_name) = get_source(sess);
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,13 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
match tcx.def_kind(def_id) {
DefKind::Static { .. } => {
tcx.ensure().typeck(def_id);
tcx.ensure_ok().typeck(def_id);
maybe_check_static_with_link_section(tcx, def_id);
check_static_inhabited(tcx, def_id);
check_static_linkage(tcx, def_id);
}
DefKind::Const => {
tcx.ensure().typeck(def_id);
tcx.ensure_ok().typeck(def_id);
}
DefKind::Enum => {
check_enum(tcx, def_id);
Expand All @@ -804,7 +804,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
DefKind::Impl { of_trait } => {
if of_trait && let Some(impl_trait_header) = tcx.impl_trait_header(def_id) {
if tcx
.ensure()
.ensure_ok()
.coherent_trait(impl_trait_header.trait_ref.instantiate_identity().def_id)
.is_ok()
{
Expand Down Expand Up @@ -1042,7 +1042,7 @@ fn check_impl_items_against_trait<'tcx>(
continue;
};

let res = tcx.ensure().compare_impl_item(impl_item.expect_local());
let res = tcx.ensure_ok().compare_impl_item(impl_item.expect_local());

if res.is_ok() {
match ty_impl_item.kind {
Expand Down Expand Up @@ -1488,7 +1488,7 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {

for v in def.variants() {
if let ty::VariantDiscr::Explicit(discr_def_id) = v.discr {
tcx.ensure().typeck(discr_def_id.expect_local());
tcx.ensure_ok().typeck(discr_def_id.expect_local());
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ pub(super) fn check_type_bounds<'tcx>(
) -> Result<(), ErrorGuaranteed> {
// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
// other `Foo` impls are incoherent.
tcx.ensure().coherent_trait(impl_trait_ref.def_id)?;
tcx.ensure_ok().coherent_trait(impl_trait_ref.def_id)?;

let param_env = tcx.param_env(impl_ty.def_id);
debug!(?param_env);
Expand Down
16 changes: 9 additions & 7 deletions compiler/rustc_hir_analysis/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ fn check_associated_item(

// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
// other `Foo` impls are incoherent.
tcx.ensure()
tcx.ensure_ok()
.coherent_trait(tcx.parent(item.trait_item_def_id.unwrap_or(item_id.into())))?;

let self_ty = match item.container {
Expand Down Expand Up @@ -1354,7 +1354,7 @@ fn check_impl<'tcx>(
let trait_ref = tcx.impl_trait_ref(item.owner_id).unwrap().instantiate_identity();
// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
// other `Foo` impls are incoherent.
tcx.ensure().coherent_trait(trait_ref.def_id)?;
tcx.ensure_ok().coherent_trait(trait_ref.def_id)?;
let trait_span = hir_trait_ref.path.span;
let trait_ref = wfcx.normalize(
trait_span,
Expand Down Expand Up @@ -2268,11 +2268,13 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
fn check_mod_type_wf(tcx: TyCtxt<'_>, module: LocalModDefId) -> Result<(), ErrorGuaranteed> {
let items = tcx.hir_module_items(module);
let res = items
.par_items(|item| tcx.ensure().check_well_formed(item.owner_id.def_id))
.and(items.par_impl_items(|item| tcx.ensure().check_well_formed(item.owner_id.def_id)))
.and(items.par_trait_items(|item| tcx.ensure().check_well_formed(item.owner_id.def_id)))
.and(items.par_foreign_items(|item| tcx.ensure().check_well_formed(item.owner_id.def_id)))
.and(items.par_opaques(|item| tcx.ensure().check_well_formed(item)));
.par_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id))
.and(items.par_impl_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)))
.and(items.par_trait_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)))
.and(
items.par_foreign_items(|item| tcx.ensure_ok().check_well_formed(item.owner_id.def_id)),
)
.and(items.par_opaques(|item| tcx.ensure_ok().check_well_formed(item)));
if module == LocalModDefId::CRATE_DEF_ID {
super::entry::check_for_entry_fn(tcx);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fn visit_implementation_of_coerce_unsized(checker: &Checker<'_>) -> Result<(), E
// errors; other parts of the code may demand it for the info of
// course.
let span = tcx.def_span(impl_did);
tcx.at(span).ensure().coerce_unsized_info(impl_did)
tcx.at(span).ensure_ok().coerce_unsized_info(impl_did)
}

fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<(), ErrorGuaranteed> {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_analysis/src/coherence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) -> Result<(), ErrorGuaranteed>
let Some(impls) = tcx.all_local_trait_impls(()).get(&def_id) else { return Ok(()) };
// Trigger building the specialization graph for the trait. This will detect and report any
// overlap errors.
let mut res = tcx.ensure().specialization_graph_of(def_id);
let mut res = tcx.ensure_ok().specialization_graph_of(def_id);

for &impl_def_id in impls {
let trait_header = tcx.impl_trait_header(impl_def_id).unwrap();
Expand All @@ -162,7 +162,7 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) -> Result<(), ErrorGuaranteed>
.and(check_impl(tcx, impl_def_id, trait_ref, trait_def))
.and(check_object_overlap(tcx, impl_def_id, trait_ref))
.and(unsafety::check_item(tcx, impl_def_id, trait_header, trait_def))
.and(tcx.ensure().orphan_check_impl(impl_def_id))
.and(tcx.ensure_ok().orphan_check_impl(impl_def_id))
.and(builtin::check_trait(tcx, def_id, impl_def_id, trait_header));
}

Expand Down
Loading