Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
93b960e
Do not attempt generating imports for extern types
mati865 Mar 20, 2026
e6098df
Remove `TaggedQueryKey::def_kind`
Zoxc Mar 14, 2026
3d94526
Split out the creation of `Cycle` to a new `process_cycle` function
Zoxc Mar 13, 2026
8717b4b
Use a different name for fast try builds
Kobzol Apr 1, 2026
cf4e8c6
GCI: During reachability analysis don't try to evaluate the initializ…
fmease Mar 2, 2026
51c4299
coretests: add argument order regression tests for min_by/max_by/minm…
Vastargazing Apr 3, 2026
e7a00df
Update Fira Mono License Information
kaepr Apr 4, 2026
29d70d4
Update license-metadata with FiraMono license
kaepr Apr 4, 2026
c0b383c
Add more info about where autodiff can be applied
ZuseZ4 Apr 4, 2026
3a7ffdc
add current autodiff limitations
ZuseZ4 Apr 4, 2026
256f036
constify Step for NonZero ints
Lars-Schumann Apr 4, 2026
92426ef
library: std: motor: use OS' process::exit in abort_internal
lasiotus Apr 5, 2026
c324d6e
Simplify attribute validation
JonathanBrouwer Apr 3, 2026
abb15f5
Remove `emit_fatal_malformed_builtin_attribute`
JonathanBrouwer Apr 4, 2026
cb87c36
Remove template from BUILTIN_ATTRIBUTES
JonathanBrouwer Apr 4, 2026
f967bf3
Remove EncodeCrossCrate from BUILTIN_ATTRIBUTES
JonathanBrouwer Apr 4, 2026
eecf63c
Remove AttributeDuplicates from BUILTIN_ATTRIBUTES
JonathanBrouwer Apr 4, 2026
9058b5f
Remove AttributeType from BUILTIN_ATTRIBUTES
JonathanBrouwer Apr 4, 2026
efbc155
Move test files into appropriate directories
ujjwalvishwakarma2006 Apr 6, 2026
9181351
Add issue links at the top
ujjwalvishwakarma2006 Apr 6, 2026
9d96a26
Re-use existing Fira(Sans) license for Mono fonts
kaepr Apr 6, 2026
057b24e
Update static_files to only include fira_license
kaepr Apr 6, 2026
adaff73
fixes rustdoc build script
kaepr Apr 6, 2026
262d35b
Update wasm-component-ld to 0.5.22
alexcrichton Apr 6, 2026
43ec620
stabilize check-cfg suggestions
chenyukang Apr 6, 2026
8930f50
c-b: Export inverse hyperbolic trigonometric functions
tgross35 Apr 7, 2026
6b6bf8d
Remove unused attribute check for unparsed builtin attributes
JonathanBrouwer Apr 4, 2026
89db636
Reformat builtin_attrs.rs
JonathanBrouwer Apr 7, 2026
7f06f55
Remove not needed PhantomData
aerooneqq Apr 7, 2026
7ce2d51
add regression test
Kcang-gna Apr 6, 2026
db37383
Fix pin docs
guiyuanju Apr 7, 2026
86f9e83
intrinsics: no `cfg(target_arch)` on scalable
davidtwco Apr 7, 2026
eacf5b8
Generate more verbose error delegation
aerooneqq Apr 7, 2026
03b453c
Fix no results when searching for == in doc
chenyukang Apr 7, 2026
e751cb8
bootstrap: Print why `if-unchanged` isn't downloading rustc
jyn514 Mar 23, 2026
9b5e085
Don't consider `bootstrap/defaults` to invalidate the rustc cache
jyn514 Mar 23, 2026
cdde491
Document the `-quick` job suffix
Kobzol Apr 7, 2026
a5ff88b
Rollup merge of #150965 - chenyukang:yukang-fix-doc-search-150921, r=…
JonathanBrouwer Apr 7, 2026
20bed53
Rollup merge of #153999 - Zoxc:rem-TaggedQueryKey-def_kind-uses, r=pe…
JonathanBrouwer Apr 7, 2026
180f323
Rollup merge of #154146 - Zoxc:cycle-split-diag, r=petrochenkov
JonathanBrouwer Apr 7, 2026
edddc21
Rollup merge of #154147 - mati865:raw-dylib-extern-types, r=petrochenkov
JonathanBrouwer Apr 7, 2026
91b6321
Rollup merge of #154812 - kaepr:fira-mono-license, r=notriddle,lolbin…
JonathanBrouwer Apr 7, 2026
e0ce351
Rollup merge of #154880 - ferrocene:jyn/download-rustc-improvements, …
JonathanBrouwer Apr 7, 2026
70651e3
Rollup merge of #154886 - chenyukang:yukang-fix-cfg-sugg, r=JonathanB…
JonathanBrouwer Apr 7, 2026
9665f08
Rollup merge of #154889 - alexcrichton:update-wasm-component-ld, r=Ma…
JonathanBrouwer Apr 7, 2026
bdc9dc4
Rollup merge of #154928 - guiyuanju:fix-pin-doc, r=chenyukang
JonathanBrouwer Apr 7, 2026
e082227
Rollup merge of #154942 - aerooneqq:delegation-unlowered-path-ice, r=…
JonathanBrouwer Apr 7, 2026
e3615a3
Rollup merge of #153269 - fmease:gci-reach-no-eval, r=BoxyUwU
JonathanBrouwer Apr 7, 2026
2875d8e
Rollup merge of #154506 - ujjwalvishwakarma2006:migrate-transmute-tes…
JonathanBrouwer Apr 7, 2026
4e2182c
Rollup merge of #154673 - Kobzol:try-job-quick, r=jieyouxu
JonathanBrouwer Apr 7, 2026
6ee4118
Rollup merge of #154761 - Vastargazing:add-regression-tests-cmp-argum…
JonathanBrouwer Apr 7, 2026
3352861
Rollup merge of #154795 - ZuseZ4:autodiff-general-docs, r=oli-obk
JonathanBrouwer Apr 7, 2026
0c94559
Rollup merge of #154808 - JonathanBrouwer:attr_cleanup, r=jdonszelmann
JonathanBrouwer Apr 7, 2026
df0712d
Rollup merge of #154825 - Lars-Schumann:non-zero-const-step, r=jhpratt
JonathanBrouwer Apr 7, 2026
87b4815
Rollup merge of #154837 - moturus:motor-os-abort, r=jhpratt
JonathanBrouwer Apr 7, 2026
2c77e24
Rollup merge of #154866 - Kcang-gna:add-regression-test-for-#146514, …
JonathanBrouwer Apr 7, 2026
a96fa87
Rollup merge of #154922 - tgross35:builtins-inverse-trig, r=RalfJung
JonathanBrouwer Apr 7, 2026
3e14c2a
Rollup merge of #154931 - aerooneqq:delegation-small-cleanup, r=petro…
JonathanBrouwer Apr 7, 2026
2895451
Rollup merge of #154950 - davidtwco:scalable-no-cfg, r=RalfJung
JonathanBrouwer Apr 7, 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
52 changes: 26 additions & 26 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6221,9 +6221,9 @@ dependencies = [

[[package]]
name = "wasi-preview1-component-adapter-provider"
version = "40.0.0"
version = "43.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb5e2b9858989c3a257de4ca169977f4f79897b64e4f482f188f4fcf8ac557d1"
checksum = "93759d6fd0db242718bdcc6e4626eff8b0f3124ee7e58e47177a59f561baf164"

[[package]]
name = "wasm-bindgen"
Expand Down Expand Up @@ -6272,9 +6272,9 @@ dependencies = [

[[package]]
name = "wasm-component-ld"
version = "0.5.21"
version = "0.5.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59dcd765f510df84d1677a502c49057761486597a95950b4c92153e5707af091"
checksum = "216ca7b603f362831b31db4e2cdea1fa3609edd7177792fa64f62a80e10aa917"
dependencies = [
"anyhow",
"clap",
Expand All @@ -6283,7 +6283,7 @@ dependencies = [
"libc",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.245.1",
"wasmparser 0.246.2",
"wat",
"windows-sys 0.61.2",
"winsplit",
Expand All @@ -6310,24 +6310,24 @@ dependencies = [

[[package]]
name = "wasm-encoder"
version = "0.245.1"
version = "0.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9dca005e69bf015e45577e415b9af8c67e8ee3c0e38b5b0add5aa92581ed5c"
checksum = "61fb705ce81adde29d2a8e99d87995e39a6e927358c91398f374474746070ef7"
dependencies = [
"leb128fmt",
"wasmparser 0.245.1",
"wasmparser 0.246.2",
]

[[package]]
name = "wasm-metadata"
version = "0.245.1"
version = "0.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da55e60097e8b37b475a0fa35c3420dd71d9eb7bd66109978ab55faf56a57efb"
checksum = "e3e4c2aa916c425dcca61a6887d3e135acdee2c6d0ed51fd61c08d41ddaf62b1"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder 0.245.1",
"wasmparser 0.245.1",
"wasm-encoder 0.246.2",
"wasmparser 0.246.2",
]

[[package]]
Expand All @@ -6352,9 +6352,9 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.245.1"
version = "0.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f08c9adee0428b7bddf3890fc27e015ac4b761cc608c822667102b8bfd6995e"
checksum = "71cde4757396defafd25417cfb36aa3161027d06d865b0c24baaae229aac005d"
dependencies = [
"bitflags",
"hashbrown 0.16.1",
Expand All @@ -6365,22 +6365,22 @@ dependencies = [

[[package]]
name = "wast"
version = "245.0.1"
version = "246.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28cf1149285569120b8ce39db8b465e8a2b55c34cbb586bd977e43e2bc7300bf"
checksum = "fe3fe8e3bf88ad96d031b4181ddbd64634b17cb0d06dfc3de589ef43591a9a62"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width 0.2.2",
"wasm-encoder 0.245.1",
"wasm-encoder 0.246.2",
]

[[package]]
name = "wat"
version = "1.245.1"
version = "1.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd48d1679b6858988cb96b154dda0ec5bbb09275b71db46057be37332d5477be"
checksum = "4bd7fda1199b94fff395c2d19a153f05dbe7807630316fa9673367666fd2ad8c"
dependencies = [
"wast",
]
Expand Down Expand Up @@ -6811,9 +6811,9 @@ dependencies = [

[[package]]
name = "wit-component"
version = "0.245.1"
version = "0.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4894f10d2d5cbc17c77e91f86a1e48e191a788da4425293b55c98b44ba3fcac9"
checksum = "1936c26cb24b93dc36bf78fb5dc35c55cd37f66ecdc2d2663a717d9fb3ee951e"
dependencies = [
"anyhow",
"bitflags",
Expand All @@ -6822,17 +6822,17 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.245.1",
"wasm-encoder 0.246.2",
"wasm-metadata",
"wasmparser 0.245.1",
"wasmparser 0.246.2",
"wit-parser",
]

[[package]]
name = "wit-parser"
version = "0.245.1"
version = "0.246.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330698718e82983499419494dd1e3d7811a457a9bf9f69734e8c5f07a2547929"
checksum = "fd979042b5ff288607ccf3b314145435453f20fc67173195f91062d2289b204d"
dependencies = [
"anyhow",
"hashbrown 0.16.1",
Expand All @@ -6844,7 +6844,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.245.1",
"wasmparser 0.246.2",
]

[[package]]
Expand Down
75 changes: 34 additions & 41 deletions compiler/rustc_ast_lowering/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
//! also be emitted during HIR ty lowering.

use std::iter;
use std::marker::PhantomData;

use ast::visit::Visitor;
use hir::def::{DefKind, PartialRes, Res};
Expand Down Expand Up @@ -128,14 +127,12 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
{
self.get_sig_id(delegation_info.resolution_node, span)
} else {
return self.generate_delegation_error(
self.dcx().span_delayed_bug(
span,
format!("LoweringContext: the delegation {:?} is unresolved", item_id),
),
self.dcx().span_delayed_bug(
span,
delegation,
format!("LoweringContext: the delegation {:?} is unresolved", item_id),
);

return self.generate_delegation_error(span, delegation);
};

match sig_id {
Expand Down Expand Up @@ -172,7 +169,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {

DelegationResults { body_id, sig, ident, generics }
}
Err(err) => self.generate_delegation_error(err, span, delegation),
Err(_) => self.generate_delegation_error(span, delegation),
}
}

Expand Down Expand Up @@ -420,7 +417,6 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
resolver: this.resolver,
path_id: delegation.id,
self_param_id: pat_node_id,
phantom: PhantomData,
};
self_resolver.visit_block(block);
// Target expr needs to lower `self` path.
Expand Down Expand Up @@ -604,7 +600,6 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {

fn generate_delegation_error(
&mut self,
err: ErrorGuaranteed,
span: Span,
delegation: &Delegation,
) -> DelegationResults<'hir> {
Expand All @@ -622,36 +617,35 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
let ident = self.lower_ident(delegation.ident);

let body_id = self.lower_body(|this| {
let body_expr = match delegation.body.as_ref() {
Some(box block) => {
// Generates a block when we failed to resolve delegation, where a target expression is its only statement,
// thus there will be no ICEs on further stages of analysis (see #144594)

// As we generate a void function we want to convert target expression to statement to avoid additional
// errors, such as mismatched return type
let stmts = this.arena.alloc_from_iter([hir::Stmt {
hir_id: this.next_id(),
kind: rustc_hir::StmtKind::Semi(
this.arena.alloc(this.lower_target_expr(block)),
),
span,
}]);

let block = this.arena.alloc(hir::Block {
stmts,
expr: None,
hir_id: this.next_id(),
rules: hir::BlockCheckMode::DefaultBlock,
span,
targeted_by_break: false,
});
let path = this.lower_qpath(
delegation.id,
&delegation.qself,
&delegation.path,
ParamMode::Optional,
AllowReturnTypeNotation::No,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
None,
);

hir::ExprKind::Block(block, None)
}
None => hir::ExprKind::Err(err),
let callee_path = this.arena.alloc(this.mk_expr(hir::ExprKind::Path(path), span));
let args = if let Some(box block) = delegation.body.as_ref() {
this.arena.alloc_slice(&[this.lower_target_expr(block)])
} else {
&mut []
};

(&[], this.mk_expr(body_expr, span))
let call = this.arena.alloc(this.mk_expr(hir::ExprKind::Call(callee_path, args), span));

let block = this.arena.alloc(hir::Block {
stmts: &[],
expr: Some(call),
hir_id: this.next_id(),
rules: hir::BlockCheckMode::DefaultBlock,
span,
targeted_by_break: false,
});

(&[], this.mk_expr(hir::ExprKind::Block(block, None), span))
});

let generics = hir::Generics::empty();
Expand All @@ -673,14 +667,13 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
}
}

struct SelfResolver<'a, 'tcx, R> {
struct SelfResolver<'a, R> {
resolver: &'a mut R,
path_id: NodeId,
self_param_id: NodeId,
phantom: PhantomData<&'tcx ()>,
}

impl<'tcx, R: ResolverAstLoweringExt<'tcx>> SelfResolver<'_, 'tcx, R> {
impl<'tcx, R: ResolverAstLoweringExt<'tcx>> SelfResolver<'_, R> {
fn try_replace_id(&mut self, id: NodeId) {
if let Some(res) = self.resolver.get_partial_res(id)
&& let Some(Res::Local(sig_id)) = res.full_res()
Expand All @@ -692,7 +685,7 @@ impl<'tcx, R: ResolverAstLoweringExt<'tcx>> SelfResolver<'_, 'tcx, R> {
}
}

impl<'ast, 'a, 'tcx, R: ResolverAstLoweringExt<'tcx>> Visitor<'ast> for SelfResolver<'a, 'tcx, R> {
impl<'ast, 'tcx, R: ResolverAstLoweringExt<'tcx>> Visitor<'ast> for SelfResolver<'_, R> {
fn visit_id(&mut self, id: NodeId) {
self.try_replace_id(id);
}
Expand Down
61 changes: 14 additions & 47 deletions compiler/rustc_attr_parsing/src/validate_attr.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//! Meta-syntax validation logic of attributes for post-expansion.

use std::convert::identity;
use std::slice;

use rustc_ast::token::Delimiter;
use rustc_ast::tokenstream::DelimSpan;
use rustc_ast::{
self as ast, AttrArgs, Attribute, DelimArgs, MetaItem, MetaItemInner, MetaItemKind, Safety,
};
use rustc_errors::{Applicability, FatalError, PResult};
use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
use rustc_errors::{Applicability, PResult};
use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP};
use rustc_hir::AttrPath;
use rustc_hir::lints::AttributeLintKind;
use rustc_parse::parse_in;
Expand All @@ -19,43 +18,23 @@ use rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT;
use rustc_session::parse::ParseSess;
use rustc_span::{Span, Symbol, sym};

use crate::{AttributeParser, Late, session_diagnostics as errors};
use crate::session_diagnostics as errors;

pub fn check_attr(psess: &ParseSess, attr: &Attribute) {
if attr.is_doc_comment() || attr.has_name(sym::cfg_trace) || attr.has_name(sym::cfg_attr_trace)
// Built-in attributes are parsed in their respective attribute parsers, so can be ignored here
if attr.is_doc_comment()
|| attr.name().is_some_and(|name| BUILTIN_ATTRIBUTE_MAP.contains_key(&name))
{
return;
}

let builtin_attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name));

// Check input tokens for built-in and key-value attributes.
match builtin_attr_info {
// `rustc_dummy` doesn't have any restrictions specific to built-in attributes.
Some(BuiltinAttribute { name, template, .. }) => {
if AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(&name)) {
return;
}
match parse_meta(psess, attr) {
// Don't check safety again, we just did that
Ok(meta) => {
check_builtin_meta_item(psess, &meta, attr.style, *name, *template, false)
}
Err(err) => {
err.emit();
}
}
}
_ => {
let attr_item = attr.get_normal_item();
if let AttrArgs::Eq { .. } = attr_item.args.unparsed_ref().unwrap() {
// All key-value attributes are restricted to meta-item syntax.
match parse_meta(psess, attr) {
Ok(_) => {}
Err(err) => {
err.emit();
}
}
let attr_item = attr.get_normal_item();
if let AttrArgs::Eq { .. } = attr_item.args.unparsed_ref().unwrap() {
// All key-value attributes are restricted to meta-item syntax.
match parse_meta(psess, attr) {
Ok(_) => {}
Err(err) => {
err.emit();
}
}
}
Expand Down Expand Up @@ -170,7 +149,7 @@ pub fn check_builtin_meta_item(
}
}

fn emit_malformed_attribute(
pub fn emit_malformed_attribute(
psess: &ParseSess,
style: ast::AttrStyle,
span: Span,
Expand Down Expand Up @@ -232,15 +211,3 @@ fn emit_malformed_attribute(
err.emit();
}
}

pub fn emit_fatal_malformed_builtin_attribute(
psess: &ParseSess,
attr: &Attribute,
name: Symbol,
) -> ! {
let template = BUILTIN_ATTRIBUTE_MAP.get(&name).expect("builtin attr defined").template;
emit_malformed_attribute(psess, attr.style, attr.span, name, template);
// This is fatal, otherwise it will likely cause a cascade of other errors
// (and an error here is expected to be very rare).
FatalError.raise()
}
Loading
Loading