Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2261154
core: add Peekable::next_if_map
kennytm Jul 10, 2025
bbf08d8
add a test with incorrect `if let`-`super let` drop order
dianne Aug 13, 2025
8fc3938
fix scope of `super let` bindings within `if let`
dianne Aug 13, 2025
52063ae
stabilize path_add_extension
hanna-kruppe Aug 10, 2025
8dbdb17
On binding not present in all patterns, suggest potential typo
estebank Aug 24, 2025
bcfc9b5
inline at the callsite & warn when target features mismatch
Jamesbarford Aug 21, 2025
fc7de99
Ensure we emit an allocator shim when only some crate types need one
bjorn3 Aug 28, 2025
1d30900
Fix typo in comment
bjorn3 Aug 28, 2025
f4888c2
Correctly handle different crate types disagreeing if the allocator s…
bjorn3 Aug 28, 2025
bd0ea61
Add test for typo in or-pattern binding
estebank Aug 29, 2025
cb9cd8f
On binding not present in all patterns, look at consts and unit struc…
estebank Aug 30, 2025
00f6fe1
On unused binding in pattern, suggest unit struct/variant with simila…
estebank Aug 30, 2025
3355f4b
Suggest constant on unused binding in a pattern
estebank Aug 30, 2025
86085b4
Avoid unnecessary suggestion in or-pattern
estebank Aug 30, 2025
a44b180
add `#[must_use]` to `array::repeat`
joboet Aug 31, 2025
0711bba
Ignore test when dylibs are not supported
bjorn3 Aug 31, 2025
5e9b655
Correct typo in `rustc_errors` comment
smoelius Sep 2, 2025
5b43244
Add LSX accelerated implementation for source file analysis
heiher Aug 28, 2025
a8537ab
Remove special implementation of `PartialEq` for `InvisibleOrigin` ou…
Kobzol Sep 1, 2025
5d9f8fc
llvm: nvptx: Layout update to match LLVM
maurer Sep 2, 2025
5a9e2e4
docs(std): add missing closing code block fences in doc comments
AudaciousAxiom Sep 2, 2025
43873db
test(rustdoc): show the wrong `--emit` precedence
weihanglo Sep 2, 2025
af0d6f1
compiletest: cygwin follows windows in using PATH for dynamic libraries
jeremyd2019 Sep 2, 2025
d9dc20c
raw_vec.rs: Remove superfluous fn alloc_guard
btj Aug 22, 2025
0fa93a3
Disallow frontmatter in `--cfg` and `--check-cfg` arguments
Urgau Sep 2, 2025
c5dd32e
fix(rustdoc): match rustc `--emit` precedence
weihanglo Sep 2, 2025
df5896a
Rename `ToolRustc` to `ToolRustcPrivate`
Kobzol Sep 2, 2025
f19c33e
Split distcheck logic into functions
Kobzol Sep 2, 2025
df2caed
refactor tests to use TestCtx
Shourya742 Sep 3, 2025
c4a5408
Make test parallel
Shourya742 Sep 3, 2025
9f3fe40
remove thread option from self-test invocation
Shourya742 Sep 3, 2025
5c4b61b
don't uppercase error messages
scrabsha Sep 1, 2025
fe90610
Check `rustc-dev` in `distcheck`
Kobzol Sep 2, 2025
a5f52a9
Uncomment code to add scraped rustdoc examples in loaded paths
GuillaumeGomez Sep 3, 2025
e7674cb
rustdoc-search: add test case for indexing every item type
notriddle Sep 2, 2025
fcc413f
htmldocck: fix a bug in relative paths / globs
notriddle Sep 2, 2025
c914c47
Add `read_buf` equivalents for positioned reads
niklasf Apr 29, 2025
fea27a6
triagebot: configure some pings when certain attributes are used
RalfJung Sep 3, 2025
2d20ee7
support keyword-based mentions in tidy
RalfJung Sep 3, 2025
f073f64
Rollup merge of #140459 - niklasf:feature/read-buf-at, r=tgross35
Zalathar Sep 4, 2025
732802c
Rollup merge of #143725 - kennytm:peekable_next_if_map, r=jhpratt
Zalathar Sep 4, 2025
98f6887
Rollup merge of #145209 - hanna-kruppe:path_add_extension, r=tgross35
Zalathar Sep 4, 2025
cd59ee7
Rollup merge of #145342 - dianne:if-let-super-let, r=nnethercote
Zalathar Sep 4, 2025
d71a9b6
Rollup merge of #145750 - btj:drop-alloc-guard, r=tgross35
Zalathar Sep 4, 2025
3a6ae11
Rollup merge of #145827 - estebank:issue-51976, r=jackh726
Zalathar Sep 4, 2025
f90cc35
Rollup merge of #145932 - JamieCunliffe:target-feature-inlining, r=ja…
Zalathar Sep 4, 2025
6c77c4c
Rollup merge of #145962 - bjorn3:linkage_fixes, r=WaffleLapkin
Zalathar Sep 4, 2025
2952b99
Rollup merge of #145963 - heiher:src-analysis-lsx, r=lqd
Zalathar Sep 4, 2025
c7a11f4
Rollup merge of #146054 - joboet:array-repeat-must_use, r=ibraheemdev
Zalathar Sep 4, 2025
57e8a53
Rollup merge of #146090 - Kobzol:invisible-origin-eq, r=petrochenkov
Zalathar Sep 4, 2025
6f490f7
Rollup merge of #146112 - scrabsha:push-utkysktvulto, r=WaffleLapkin
Zalathar Sep 4, 2025
5848328
Rollup merge of #146120 - smoelius:patch-3, r=lqd
Zalathar Sep 4, 2025
1456b67
Rollup merge of #146124 - Kobzol:distcheck-ext, r=jieyouxu
Zalathar Sep 4, 2025
9867486
Rollup merge of #146127 - Kobzol:rename-tool-rustc, r=jieyouxu
Zalathar Sep 4, 2025
3b365d8
Rollup merge of #146131 - notriddle:rustdoc-search-load-itemtype-test…
Zalathar Sep 4, 2025
a1469aa
Rollup merge of #146134 - maurer:nvptx-sync, r=durin42
Zalathar Sep 4, 2025
b27c94a
Rollup merge of #146136 - AudaciousAxiom:docs/missing-closing-code-bl…
Zalathar Sep 4, 2025
10cbfe6
Rollup merge of #146137 - Urgau:cfg-disallow-frontmatter, r=fmease
Zalathar Sep 4, 2025
9214b18
Rollup merge of #146140 - jeremyd2019:patch-1, r=jieyouxu
Zalathar Sep 4, 2025
8fc568e
Rollup merge of #146150 - weihanglo:rustdoc-emit, r=aDotInTheVoid
Zalathar Sep 4, 2025
8b2a64f
Rollup merge of #146155 - Shourya742:2025-09-03-make-test-run-paralle…
Zalathar Sep 4, 2025
c81fffa
Rollup merge of #146161 - GuillaumeGomez:loaded-paths-scraped-example…
Zalathar Sep 4, 2025
11ea573
Rollup merge of #146172 - RalfJung:triagebot-keyword-mentions, r=Urgau
Zalathar Sep 4, 2025
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
20 changes: 3 additions & 17 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ pub enum CommentKind {
Block,
}

// This type must not implement `Hash` due to the unusual `PartialEq` impl below.
#[derive(Copy, Clone, Debug, Encodable, Decodable, HashStable_Generic)]
#[derive(Copy, Clone, PartialEq, Debug, Encodable, Decodable, HashStable_Generic)]
pub enum InvisibleOrigin {
// From the expansion of a metavariable in a declarative macro.
MetaVar(MetaVarKind),
Expand All @@ -45,20 +44,6 @@ impl InvisibleOrigin {
}
}

impl PartialEq for InvisibleOrigin {
#[inline]
fn eq(&self, _other: &InvisibleOrigin) -> bool {
// When we had AST-based nonterminals we couldn't compare them, and the
// old `Nonterminal` type had an `eq` that always returned false,
// resulting in this restriction:
// https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment
// This `eq` emulates that behaviour. We could consider lifting this
// restriction now but there are still cases involving invisible
// delimiters that make it harder than it first appears.
false
}
}

/// Annoyingly similar to `NonterminalKind`, but the slight differences are important.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Encodable, Decodable, Hash, HashStable_Generic)]
pub enum MetaVarKind {
Expand Down Expand Up @@ -142,7 +127,8 @@ impl Delimiter {
}
}

// This exists because `InvisibleOrigin`s should be compared. It is only used for assertions.
// This exists because `InvisibleOrigin`s should not be compared. It is only used for
// assertions.
pub fn eq_ignoring_invisible_origin(&self, other: &Delimiter) -> bool {
match (self, other) {
(Delimiter::Parenthesis, Delimiter::Parenthesis) => true,
Expand Down
20 changes: 18 additions & 2 deletions compiler/rustc_expand/src/mbe/macro_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ use std::rc::Rc;

pub(crate) use NamedMatch::*;
pub(crate) use ParseResult::*;
use rustc_ast::token::{self, DocComment, NonterminalKind, Token};
use rustc_ast::token::{self, DocComment, NonterminalKind, Token, TokenKind};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::ErrorGuaranteed;
use rustc_lint_defs::pluralize;
Expand Down Expand Up @@ -397,7 +397,23 @@ fn token_name_eq(t1: &Token, t2: &Token) -> bool {
{
ident1.name == ident2.name && is_raw1 == is_raw2
} else {
t1.kind == t2.kind
// Note: we SHOULD NOT use `t1.kind == t2.kind` here, and we should instead compare the
// tokens using the special comparison logic below.
// It makes sure that variants containing `InvisibleOrigin` will
// never compare equal to one another.
//
// When we had AST-based nonterminals we couldn't compare them, and the
// old `Nonterminal` type had an `eq` that always returned false,
// resulting in this restriction:
// <https://doc.rust-lang.org/nightly/reference/macros-by-example.html#forwarding-a-matched-fragment>
// This comparison logic emulates that behaviour. We could consider lifting this
// restriction now but there are still cases involving invisible
// delimiters that make it harder than it first appears.
match (t1.kind, t2.kind) {
(TokenKind::OpenInvisible(_) | TokenKind::CloseInvisible(_), _)
| (_, TokenKind::OpenInvisible(_) | TokenKind::CloseInvisible(_)) => false,
(a, b) => a == b,
}
}
}

Expand Down