Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6bd5ab9
Emit error when self type is not specified and accessed
aerooneqq May 14, 2026
8f221d1
Test EII UI tests with prefer-dynamic
AsakuraMizu May 14, 2026
9faff71
actually run the temp_dir doctest
RalfJung May 12, 2026
5a12d48
Prefer tracing::instrument.
cjgillot May 14, 2026
d76d4cd
Untuple method parameters.
cjgillot May 14, 2026
6e7b089
Use DropCtxt::new_block and new_block_with_statements systematically.
cjgillot May 14, 2026
85dfeda
Correctly handle associated items in rustdoc macro expansion
GuillaumeGomez May 14, 2026
899be9f
Add regression tests for associated items in rustdoc macro expansion
GuillaumeGomez May 14, 2026
8909e79
Require UTF-8 in `Utf8Pattern::StringPattern`
qaijuang May 13, 2026
62d510d
Require EIIs to be defined when we compile a rust dylib
bjorn3 May 8, 2026
2453e45
Rollup merge of #156319 - bjorn3:eii_dylib_require_def, r=jdonszelmann
JonathanBrouwer May 15, 2026
1a92985
Rollup merge of #156493 - RalfJung:run-temp-dir, r=ChrisDenton
JonathanBrouwer May 15, 2026
73bb2c2
Rollup merge of #156556 - qaijuang:issue-156491-str-replace-utf8-patt…
JonathanBrouwer May 15, 2026
73b6ecd
Rollup merge of #156565 - aerooneqq:delegation-self-type-ice, r=petro…
JonathanBrouwer May 15, 2026
bbbbe91
Rollup merge of #156577 - AsakuraMizu:eii-default-dynamic, r=mejrs
JonathanBrouwer May 15, 2026
e1c870d
Rollup merge of #156586 - cjgillot:elaborate-new-block, r=oli-obk
JonathanBrouwer May 15, 2026
580430a
Rollup merge of #156587 - GuillaumeGomez:assoc-items-macro-expansion,…
JonathanBrouwer May 15, 2026
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
7 changes: 7 additions & 0 deletions compiler/rustc_hir_analysis/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use rustc_middle::ty::{
use rustc_span::{ErrorGuaranteed, Span, kw};

use crate::collect::ItemCtxt;
use crate::errors::DelegationSelfTypeNotSpecified;
use crate::hir_ty_lowering::HirTyLowerer;

type RemapTable = FxHashMap<u32, u32>;
Expand Down Expand Up @@ -284,6 +285,12 @@ fn get_delegation_self_ty_or_err(tcx: TyCtxt<'_>, delegation_id: LocalDefId) ->
ctx.lower_ty(tcx.hir_node(id).expect_ty())
})
.unwrap_or_else(|| {
// It is possible to attempt to get self type when it is used in signature
// (i.e., `fn default() -> Self`), so emit error here in addition to possible
// `mismatched types` error (see #156388).
let err = DelegationSelfTypeNotSpecified { span: tcx.def_span(delegation_id) };
tcx.dcx().emit_err(err);

Ty::new_error_with_message(
tcx,
tcx.def_span(delegation_id),
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir_analysis/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,6 +1670,14 @@ pub(crate) struct UnsupportedDelegation<'a> {
pub callee_span: Span,
}

#[derive(Diagnostic)]
#[diag("delegation self type is not specified")]
#[help("consider explicitly specifying self type: `reuse </* Type */ as Trait>::function`")]
pub(crate) struct DelegationSelfTypeNotSpecified {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("method should be `async` or return a future, but it is synchronous")]
pub(crate) struct MethodShouldReturnFuture {
Expand Down
Loading
Loading