-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #126824 - GuillaumeGomez:rollup-sybv8o7, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #126555 (Add `f16` inline ASM support for 32-bit ARM) - #126686 (Add `#[rustc_dump_{predicates,item_bounds}]`) - #126723 (Fix `...` in multline code-skips in suggestions) - #126731 (Bootstrap command refactoring: refactor `BootstrapCommand` (step 1)) - #126823 (Migrate `run-make/inline-always-many-cgu` to `rmake.rs`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
45 changed files
with
723 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use rustc_hir::def::DefKind; | ||
use rustc_hir::def_id::CRATE_DEF_ID; | ||
use rustc_middle::ty::TyCtxt; | ||
use rustc_span::sym; | ||
|
||
pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) { | ||
if !tcx.has_attr(CRATE_DEF_ID, sym::rustc_hidden_type_of_opaques) { | ||
return; | ||
} | ||
|
||
for id in tcx.hir().items() { | ||
let DefKind::OpaqueTy = tcx.def_kind(id.owner_id) else { continue }; | ||
|
||
let ty = tcx.type_of(id.owner_id).instantiate_identity(); | ||
|
||
tcx.dcx().emit_err(crate::errors::TypeOf { span: tcx.def_span(id.owner_id), ty }); | ||
} | ||
} | ||
|
||
pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) { | ||
for id in tcx.hir_crate_items(()).owners() { | ||
if tcx.has_attr(id, sym::rustc_dump_predicates) { | ||
let preds = tcx.predicates_of(id).instantiate_identity(tcx).predicates; | ||
let span = tcx.def_span(id); | ||
|
||
let mut diag = tcx.dcx().struct_span_err(span, sym::rustc_dump_predicates.as_str()); | ||
for pred in preds { | ||
diag.note(format!("{pred:?}")); | ||
} | ||
diag.emit(); | ||
} | ||
if tcx.has_attr(id, sym::rustc_dump_item_bounds) { | ||
let bounds = tcx.item_bounds(id).instantiate_identity(); | ||
let span = tcx.def_span(id); | ||
|
||
let mut diag = tcx.dcx().struct_span_err(span, sym::rustc_dump_item_bounds.as_str()); | ||
for bound in bounds { | ||
diag.note(format!("{bound:?}")); | ||
} | ||
diag.emit(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use rustc_middle::bug; | ||
use rustc_middle::ty::{self, TyCtxt}; | ||
use rustc_span::sym; | ||
|
||
pub(crate) fn inferred_outlives(tcx: TyCtxt<'_>) { | ||
for id in tcx.hir().items() { | ||
if !tcx.has_attr(id.owner_id, sym::rustc_outlives) { | ||
continue; | ||
} | ||
|
||
let preds = tcx.inferred_outlives_of(id.owner_id); | ||
let mut preds: Vec<_> = preds | ||
.iter() | ||
.map(|(pred, _)| match pred.kind().skip_binder() { | ||
ty::ClauseKind::RegionOutlives(p) => p.to_string(), | ||
ty::ClauseKind::TypeOutlives(p) => p.to_string(), | ||
err => bug!("unexpected clause {:?}", err), | ||
}) | ||
.collect(); | ||
preds.sort(); | ||
|
||
let span = tcx.def_span(id.owner_id); | ||
let mut err = tcx.dcx().struct_span_err(span, sym::rustc_outlives.as_str()); | ||
for pred in preds { | ||
err.note(pred); | ||
} | ||
err.emit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use rustc_hir::def::DefKind; | ||
use rustc_hir::def_id::CRATE_DEF_ID; | ||
use rustc_middle::ty::TyCtxt; | ||
use rustc_span::symbol::sym; | ||
|
||
pub(crate) fn variances(tcx: TyCtxt<'_>) { | ||
if tcx.has_attr(CRATE_DEF_ID, sym::rustc_variance_of_opaques) { | ||
for id in tcx.hir().items() { | ||
let DefKind::OpaqueTy = tcx.def_kind(id.owner_id) else { continue }; | ||
|
||
let variances = tcx.variances_of(id.owner_id); | ||
|
||
tcx.dcx().emit_err(crate::errors::VariancesOf { | ||
span: tcx.def_span(id.owner_id), | ||
variances: format!("{variances:?}"), | ||
}); | ||
} | ||
} | ||
|
||
for id in tcx.hir().items() { | ||
if !tcx.has_attr(id.owner_id, sym::rustc_variance) { | ||
continue; | ||
} | ||
|
||
let variances = tcx.variances_of(id.owner_id); | ||
|
||
tcx.dcx().emit_err(crate::errors::VariancesOf { | ||
span: tcx.def_span(id.owner_id), | ||
variances: format!("{variances:?}"), | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.