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 10 pull requests #134391

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
665d7ad
Improve testing coverage for `#[diagnostic::do_not_recommend]`
weiznich Oct 22, 2024
68cd044
Check `#[diagnostic::do_not_recommend]` for arguments
weiznich Oct 23, 2024
70ab7a7
Stabilize `#[diagnostic::do_not_recommend]`
weiznich Oct 23, 2024
fad597f
Also warn against `#[diagnostic::do_not_recommend]` on plain impls
weiznich Oct 25, 2024
577b5f3
CI: use free runners for x86_64-gnu-llvm jobs
marcoieni Dec 10, 2024
e67e9b4
fix
marcoieni Dec 10, 2024
4f0e781
split better
marcoieni Dec 11, 2024
bb88d7a
fix
marcoieni Dec 11, 2024
84ba41d
remove unnecessary change
marcoieni Dec 11, 2024
abd8352
restore command
marcoieni Dec 11, 2024
a8bc3cf
fix
marcoieni Dec 11, 2024
d74de1f
debug
marcoieni Dec 11, 2024
754fb24
debug
marcoieni Dec 11, 2024
9ed728d
debug
marcoieni Dec 11, 2024
eec9bcf
more debug
marcoieni Dec 11, 2024
fee220a
fix
marcoieni Dec 11, 2024
1f38572
fix
marcoieni Dec 11, 2024
7ce2944
test stage 1 in separate job
marcoieni Dec 12, 2024
aa0fd46
copy script
marcoieni Dec 12, 2024
a1abbaa
remove echo logs
marcoieni Dec 12, 2024
2bf1cec
refactor
marcoieni Dec 12, 2024
c2f4550
remove echo
marcoieni Dec 12, 2024
a67a71d
add files
marcoieni Dec 12, 2024
4fa9078
fix path
marcoieni Dec 12, 2024
ac078a4
fix path
marcoieni Dec 12, 2024
de16ed3
Correctly handle comments in attributes in doctests source code
GuillaumeGomez Dec 13, 2024
165f37e
rustc_mir_build: Clarify that 'mirrored' does not mean 'flipped' or '…
Enselic Dec 12, 2024
f068d8b
rustdoc-search: show `impl Trait` inline when unhighlighted
notriddle Dec 13, 2024
246835e
rustdoc-search: let From and Into be unboxed
notriddle Dec 13, 2024
0be3ed0
rustdoc-search: update documentation with notes about unboxing
notriddle Dec 13, 2024
0f82cff
Keep track of patterns that could have introduced a binding, but didn't
estebank Dec 13, 2024
8c8e8d3
Use `ErrorGuaranteed` more
estebank Dec 15, 2024
733fd03
Use `span_label` as it looks better when we show pattern missing bind…
estebank Dec 15, 2024
9c4a61f
Add ui regression test for #134221
GuillaumeGomez Dec 13, 2024
2383985
Also handle cases where attributes are unclosed
GuillaumeGomez Dec 16, 2024
bdb88c9
Avoid creating a fn sig type just to unwrap it again to get at its si…
oli-obk Dec 16, 2024
f387b9d
Properly name a def id variable
oli-obk Dec 16, 2024
4032b9d
Avoid wrapping a trivially defaultable type in `Option`
oli-obk Dec 16, 2024
1c7d54e
Deduplicate some pretty printing logic
oli-obk Dec 16, 2024
1d834c2
Avoid wrapping fn sig in a fn pointer when we want to just print the sig
oli-obk Dec 16, 2024
86e0eab
tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro …
taiki-e Dec 16, 2024
c367cc3
Remove unneeded handling of backlines in doctest attributes
GuillaumeGomez Dec 16, 2024
418ce11
Rollup merge of #132056 - weiznich:diagnostic_do_not_recommend_final_…
GuillaumeGomez Dec 16, 2024
9bc21a9
Rollup merge of #134124 - MarcoIeni:split-llvm-jobs, r=Kobzol
GuillaumeGomez Dec 16, 2024
b77879f
Rollup merge of #134197 - Enselic:mirror, r=lcnr
GuillaumeGomez Dec 16, 2024
77ba33d
Rollup merge of #134260 - GuillaumeGomez:doctest-attrs, r=notriddle
GuillaumeGomez Dec 16, 2024
cfe295a
Rollup merge of #134277 - notriddle:notriddle/inline-into, r=Guillaum…
GuillaumeGomez Dec 16, 2024
c15f2e0
Rollup merge of #134284 - estebank:issue-74863, r=lcnr
GuillaumeGomez Dec 16, 2024
70b1524
Rollup merge of #134385 - taiki-e:ui-asm-minicore, r=compiler-errors
GuillaumeGomez Dec 16, 2024
b349110
Rollup merge of #134386 - oli-obk:some-trait-impl-diff-diagnostic-cle…
GuillaumeGomez Dec 16, 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
Prev Previous commit
Next Next commit
Avoid wrapping a trivially defaultable type in Option
  • Loading branch information
oli-obk committed Dec 16, 2024
commit 4032b9ddbd9f386cc55c3d76000461a1dbb76cd9
9 changes: 3 additions & 6 deletions compiler/rustc_borrowck/src/diagnostics/region_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,8 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
) -> RegionNameHighlight {
let mut highlight = RegionHighlightMode::default();
highlight.highlighting_region_vid(self.infcx.tcx, needle_fr, counter);
let type_name = self
.infcx
.err_ctxt()
.extract_inference_diagnostics_data(ty.into(), Some(highlight))
.name;
let type_name =
self.infcx.err_ctxt().extract_inference_diagnostics_data(ty.into(), highlight).name;

debug!(
"highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
Expand Down Expand Up @@ -874,7 +871,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
let type_name = self
.infcx
.err_ctxt()
.extract_inference_diagnostics_data(yield_ty.into(), Some(highlight))
.extract_inference_diagnostics_data(yield_ty.into(), highlight)
.name;

let yield_span = match tcx.hir_node(self.mir_hir_id()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
pub fn extract_inference_diagnostics_data(
&self,
arg: GenericArg<'tcx>,
highlight: Option<ty::print::RegionHighlightMode<'tcx>>,
highlight: ty::print::RegionHighlightMode<'tcx>,
) -> InferenceDiagnosticsData {
match arg.unpack() {
GenericArgKind::Type(ty) => {
Expand All @@ -301,9 +301,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
}

let mut printer = ty::print::FmtPrinter::new(self.tcx, Namespace::TypeNS);
if let Some(highlight) = highlight {
printer.region_highlight_mode = highlight;
}
printer.region_highlight_mode = highlight;

ty.print(&mut printer).unwrap();
InferenceDiagnosticsData {
name: printer.into_buffer(),
Expand All @@ -326,9 +325,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {

debug_assert!(!origin.span.is_dummy());
let mut printer = ty::print::FmtPrinter::new(self.tcx, Namespace::ValueNS);
if let Some(highlight) = highlight {
printer.region_highlight_mode = highlight;
}
printer.region_highlight_mode = highlight;

ct.print(&mut printer).unwrap();
InferenceDiagnosticsData {
name: printer.into_buffer(),
Expand All @@ -344,9 +342,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
// to figure out which inference var is actually unresolved so that
// this path is unreachable.
let mut printer = ty::print::FmtPrinter::new(self.tcx, Namespace::ValueNS);
if let Some(highlight) = highlight {
printer.region_highlight_mode = highlight;
}
printer.region_highlight_mode = highlight;

ct.print(&mut printer).unwrap();
InferenceDiagnosticsData {
name: printer.into_buffer(),
Expand Down Expand Up @@ -422,7 +419,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
should_label_span: bool,
) -> Diag<'a> {
let arg = self.resolve_vars_if_possible(arg);
let arg_data = self.extract_inference_diagnostics_data(arg, None);
let arg_data =
self.extract_inference_diagnostics_data(arg, ty::print::RegionHighlightMode::default());

let Some(typeck_results) = &self.typeck_results else {
// If we don't have any typeck results we're outside
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,13 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
.cx
.extract_inference_diagnostics_data(
Ty::new_fn_ptr(tcx, expected).into(),
Some(expected_highlight),
expected_highlight,
)
.name;
let found_highlight = HighlightBuilder::build(found);
let found = self
.cx
.extract_inference_diagnostics_data(
Ty::new_fn_ptr(tcx, found).into(),
Some(found_highlight),
)
.extract_inference_diagnostics_data(Ty::new_fn_ptr(tcx, found).into(), found_highlight)
.name;

// Get the span of all the used type parameters in the method.
Expand Down