Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
012c356
Select cache values to verify by key fingerprint, not value fingerprint
xmakro Jul 29, 2026
833ec34
[blocked] Link to proposed LLM policy in CONTRIBUTING and pull reques…
jyn514 Jun 18, 2026
ac1e5f4
Handle slice-tailed DSTs in autodiff type trees
Dnreikronos Aug 2, 2026
82317b3
Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`
joshtriplett Aug 1, 2026
0f80d01
Bless bootstrap tests for new `rustc_ty_walk` crate
joshtriplett Aug 4, 2026
e3464ab
Avoid resolving path keywords outside TypeNS
mu001999 Aug 3, 2026
e0830fa
implement unsafe speculative flag to be used by `CmRefCell::borrow`, …
LorrensP-2158466 Aug 4, 2026
180c637
Remove rustc_middle dependency on rustc_hir_pretty
mejrs Aug 3, 2026
18e0dd9
Document zero-sized autodiff slice handling
Dnreikronos Aug 4, 2026
6794814
Add some tests for specialization.
jackh726 Aug 3, 2026
228bbb3
fix(bootstrap): Normalize the names of proc macro dependency crates
jamie-osec Aug 4, 2026
a6dfd0c
docs: fix typo in AllowExprMetavar comment
jewboi896-cmyk Aug 4, 2026
eace512
Suggest cast_signed for overflowing integer literals
YingqiDuan Aug 5, 2026
276269b
Rollup merge of #160130 - xmakro:cleanup/deterministic-verify-samplin…
JonathanBrouwer Aug 5, 2026
e07bd1f
Rollup merge of #160360 - mejrs:hir_pretty, r=nnethercote
JonathanBrouwer Aug 5, 2026
c1ceec0
Rollup merge of #160444 - mu001999-contrib:fix-160195, r=petrochenkov
JonathanBrouwer Aug 5, 2026
c4fbf66
Rollup merge of #160510 - LorrensP-2158466:res-unsafe-speculative-fla…
JonathanBrouwer Aug 5, 2026
8b2f48e
Rollup merge of #155424 - jyn514:llm-policy, r=Mark-Simulacrum
JonathanBrouwer Aug 5, 2026
58037d4
Rollup merge of #160362 - joshtriplett:ty-walk-crate, r=fee1-dead
JonathanBrouwer Aug 5, 2026
65c98f6
Rollup merge of #160390 - Dnreikronos:autodiff/slice_dst_typetree, r=…
JonathanBrouwer Aug 5, 2026
9415bcc
Rollup merge of #160420 - YingqiDuan:fix-160403-cast-signed-suggestio…
JonathanBrouwer Aug 5, 2026
95dff17
Rollup merge of #160520 - jackh726:specialization-tests, r=nikomatsakis
JonathanBrouwer Aug 5, 2026
c075bb7
Rollup merge of #160522 - clubby789:normalize-proc-macro-deps, r=jiey…
JonathanBrouwer Aug 5, 2026
dad3424
Rollup merge of #160531 - jewboi896-cmyk:patch-1, r=ShoyuVanilla
JonathanBrouwer Aug 5, 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
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<!-- homu-ignore:start -->

- [ ] I did not use an LLM to create a change in this PR.
- [ ] I used an LLM to create a change in this PR, and I have explained below how it was used.

<!--
Please read our [LLM policy] before opening a PR,
and check one of the boxes above to indicate whether you've used an LLM.
If you do not check a box, a reviewer may ask you whether an LLM was involved.
LLM contributions are not banned, but are held to a higher standard of review and correctness.

[LLM policy]: https://forge.rust-lang.org/policies/llm-usage.html

If this PR is related to an unstable feature or an otherwise tracked effort,
please link to the relevant tracking issue here. If you don't know of a related
tracking issue or there are none, feel free to ignore this.
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ that you read and understand the [rustc-dev-guide] before making a contribution.
talks about the different bots in the Rust ecosystem, the Rust development tools,
bootstrapping, the compiler architecture, source code representation, and more.

## LLM policy

We have a policy for how LLMs are allowed to be used in contributions to `rust-lang/rust`.
You can read it [on Forge][LLM policy].
For suggestions about how to use LLMs *well*, and how to review LLM-created PRs, see [the dev-guide][llm-guidance].

[LLM policy]: https://forge.rust-lang.org/policies/llm-usage.html
[llm-guidance]: https://rustc-dev-guide.rust-lang.org/llm-guidance.html

## [Getting help](https://rustc-dev-guide.rust-lang.org/getting-started.html#asking-questions)

There are many ways you can get help when you're stuck. Rust has two platforms for this:
Expand Down
15 changes: 13 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3954,6 +3954,7 @@ dependencies = [
"rustc_errors",
"rustc_expand",
"rustc_feature",
"rustc_hir",
"rustc_hir_analysis",
"rustc_hir_pretty",
"rustc_index",
Expand Down Expand Up @@ -4414,7 +4415,6 @@ dependencies = [
"rustc_graphviz",
"rustc_hashes",
"rustc_hir",
"rustc_hir_pretty",
"rustc_index",
"rustc_lint_defs",
"rustc_macros",
Expand Down Expand Up @@ -4621,7 +4621,7 @@ dependencies = [
"rustc_middle",
"rustc_session",
"rustc_span",
"rustc_ty_utils",
"rustc_ty_walk",
"tracing",
]

Expand Down Expand Up @@ -4908,6 +4908,17 @@ dependencies = [
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"rustc_ty_walk",
"tracing",
]

[[package]]
name = "rustc_ty_walk"
version = "0.0.0"
dependencies = [
"rustc_hir",
"rustc_middle",
"rustc_span",
"tracing",
]

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ fn expr_to_lit<'sess>(
}
}

/// Whether expansions of `expr` metavariables from decrarative macros
/// Whether expansions of `expr` metavariables from declarative macros
/// are permitted. Used when parsing meta items; currently, only `cfg` predicates
/// enable this option
#[derive(Clone, Copy, PartialEq, Eq)]
Expand Down
11 changes: 3 additions & 8 deletions compiler/rustc_codegen_llvm/src/builder/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,13 @@ pub(crate) fn adjust_activity_to_abi<'tcx>(
let mut del_activities = 0;
for (i, ty) in sig.inputs().iter().enumerate() {
if let Some(inner_ty) = ty.builtin_deref(true) {
if inner_ty.is_slice() {
let tail_ty = tcx.struct_tail_for_codegen(inner_ty, typing_env);
if let ty::Slice(element_ty) = tail_ty.kind() {
// Now we need to figure out the size of each slice element in memory to allow
// safety checks and usability improvements in the backend.
let sty = match inner_ty.builtin_index() {
Some(sty) => sty,
None => {
panic!("slice element type unknown");
}
};
let pci = PseudoCanonicalInput {
typing_env: TypingEnv::fully_monomorphized(),
value: sty,
value: *element_ty,
};

let layout = tcx.layout_of(pci);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_driver_impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
rustc_expand = { path = "../rustc_expand" }
rustc_feature = { path = "../rustc_feature" }
rustc_hir = { path = "../rustc_hir" }
rustc_hir_analysis = { path = "../rustc_hir_analysis" }
rustc_hir_pretty = { path = "../rustc_hir_pretty" }
rustc_index = { path = "../rustc_index" }
Expand Down
10 changes: 7 additions & 3 deletions compiler/rustc_driver_impl/src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use std::io;

use rustc_ast as ast;
use rustc_ast_pretty::pprust as pprust_ast;
use rustc_hir::intravisit;
use rustc_hir_pretty as pprust_hir;
use rustc_hir_pretty::PpAnn;
use rustc_middle::bug;
use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty};
use rustc_middle::ty::{self, TyCtxt};
Expand Down Expand Up @@ -71,7 +73,8 @@ struct HirIdentifiedAnn<'tcx> {

impl<'tcx> pprust_hir::PpAnn for HirIdentifiedAnn<'tcx> {
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested) {
self.tcx.nested(state, nested)
let this = &self.tcx as &dyn intravisit::HirTyCtxt<'_>;
this.nested(state, nested)
}

fn pre(&self, s: &mut pprust_hir::State<'_>, node: pprust_hir::AnnNode<'_>) {
Expand Down Expand Up @@ -149,11 +152,12 @@ struct HirTypedAnn<'tcx> {

impl<'tcx> pprust_hir::PpAnn for HirTypedAnn<'tcx> {
fn nested(&self, state: &mut pprust_hir::State<'_>, nested: pprust_hir::Nested) {
let this = &self.tcx as &dyn intravisit::HirTyCtxt<'_>;
let old_maybe_typeck_results = self.maybe_typeck_results.get();
if let pprust_hir::Nested::Body(id) = nested {
self.maybe_typeck_results.set(Some(self.tcx.typeck_body(id)));
}
self.tcx.nested(state, nested);
this.nested(state, nested);
self.maybe_typeck_results.set(old_maybe_typeck_results);
}

Expand Down Expand Up @@ -281,7 +285,7 @@ pub fn print<'tcx>(sess: &Session, ppm: PpMode, ex: PrintExtra<'tcx>) {
)
};
match s {
PpHirMode::Normal => f(&tcx),
PpHirMode::Normal => f(&(&tcx as &dyn intravisit::HirTyCtxt<'_>) as &dyn PpAnn),
PpHirMode::Identified => {
let annotation = HirIdentifiedAnn { tcx };
f(&annotation)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
return self.get_fn_decl(hir_id).map(|(_, fn_decl)| {
let (ty, span) = match fn_decl.output {
hir::FnRetTy::DefaultReturn(span) => ("()".to_string(), span),
hir::FnRetTy::Return(ty) => (ty_to_string(&self.tcx, ty), ty.span),
hir::FnRetTy::Return(ty) => (ty_to_string(self, ty), ty.span),
};
(span, format!("expected `{ty}` because of this return type"))
});
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
};
let removal_span = callee_expr.span.shrink_to_hi().to(call_expr.span.shrink_to_hi());
unit_variant =
Some((removal_span, descr, rustc_hir_pretty::qpath_to_string(&self.tcx, qpath)));
Some((removal_span, descr, rustc_hir_pretty::qpath_to_string(self, qpath)));
}

let callee_ty = self.resolve_vars_if_possible(callee_ty);
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use crate::diagnostics::{
use crate::op::contains_let_in_chain;
use crate::{
BreakableCtxt, CoroutineTypes, Diverges, FnCtxt, GatherLocalsVisitor, Needs,
TupleArgumentsFlag, cast, fatally_break_rust, report_unexpected_variant_res, type_error_struct,
TupleArgumentsFlag, cast, fatally_break_rust, type_error_struct,
};

impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Expand Down Expand Up @@ -589,8 +589,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ty::new_error(tcx, e)
}
Res::Def(DefKind::Variant, _) => {
let e = report_unexpected_variant_res(
tcx,
let e = self.report_unexpected_variant_res(
res,
Some(expr),
&[],
Expand Down
10 changes: 10 additions & 0 deletions compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ impl<'a, 'tcx> Deref for FnCtxt<'a, 'tcx> {
}
}

impl<'tcx> rustc_hir_pretty::PpAnn for FnCtxt<'_, 'tcx> {
fn nested(&self, state: &mut rustc_hir_pretty::State<'_>, nested: rustc_hir_pretty::Nested) {
rustc_hir_pretty::PpAnn::nested(
&(&self.tcx as &dyn rustc_hir::intravisit::HirTyCtxt<'_>),
state,
nested,
)
}
}

impl<'tcx> HirTyLowerer<'tcx> for FnCtxt<'_, 'tcx> {
fn tcx(&self) -> TyCtxt<'tcx> {
self.tcx
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let hir::FnDecl { inputs, output, .. } = fn_ptr_ty.decl;

let inputs_str =
inputs.iter().map(|ty| rustc_hir_pretty::ty_to_string(&self.tcx, ty)).join(", ");
inputs.iter().map(|ty| rustc_hir_pretty::ty_to_string(self, ty)).join(", ");

let output_str = match output {
hir::FnRetTy::DefaultReturn(_) => String::new(),
hir::FnRetTy::Return(ty) => {
format!(" -> {}", rustc_hir_pretty::ty_to_string(&self.tcx, ty))
format!(" -> {}", rustc_hir_pretty::ty_to_string(self, ty))
}
};

Expand Down
Loading
Loading