forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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 rust-lang#126760 - matthiaskrgr:rollup-w6ajurr, r=matth…
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#125627 (migration lint for `expr2024` for the edition 2024) - rust-lang#126481 (Add `powerpc-unknown-openbsd` maintaince status) - rust-lang#126613 (Print the tested value in int_log tests) - rust-lang#126617 (Expand `avx512_target_feature` to include VEX variants) - rust-lang#126686 (Add `#[rustc_dump_{predicates,item_bounds}]`) - rust-lang#126700 (Make edition dependent `:expr` macro fragment act like the edition-dependent `:pat` fragment does) - rust-lang#126707 (Pass target to inaccessible-temp-dir rmake test) - rust-lang#126757 (Properly gate `safe` keyword in pre-expansion) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
44 changed files
with
490 additions
and
171 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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.