Skip to content

Rollup of 40 pull requests #140573

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

Closed
wants to merge 171 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
8099510
Fix linking for symbols starting with ?
checkraisefold Sep 25, 2024
784d47b
Add a test
checkraisefold Dec 31, 2024
a4c628c
Significant test improvements
checkraisefold Dec 31, 2024
d45fd5e
Refactor CGU partitioning a little
saethlin Jan 12, 2025
27cf264
Enforce compiler-builtins CGU partitioning in the compiler
saethlin Jan 12, 2025
f81ebfb
Match LLVM behavior more closely
checkraisefold Jan 14, 2025
bf36338
Accept tidy changes
checkraisefold Jan 14, 2025
9c3b53d
Apply tidy suggestion (2)
checkraisefold Jan 14, 2025
e17debb
Test that compiler-builtins is partitioned right
saethlin Jan 12, 2025
3d41095
Put shebang at the top of pretty-print
VlaDexa Feb 23, 2025
8c80d2e
Add Three Codegen Tests
veera-sivarajan Dec 21, 2024
cf26d82
chore: remove redundant words in comment
pudongair Mar 26, 2025
660d1e2
Fix linker-plugin-lto only doing thin lto
Flakebi Mar 28, 2025
d81559a
Refactor `diy_float`
TDecking Mar 31, 2025
ff37c7d
std: use the address of `errno` to identify threads in `unique_thread…
joboet Apr 1, 2025
cbfe1f5
Restrict the cases where `ptr_eq` triggers
samueltardieu Apr 2, 2025
a576362
Document async block control flow in async keyword
Lynnesbian Apr 10, 2025
e2caab1
Doc more control flow behaviour for return keyword
Lynnesbian Apr 10, 2025
e5fb426
docs: Add example to `Iterator::take` with `by_ref`
ongardie Apr 14, 2025
0369ccb
Fix some grammar errors and hyperlinks in doc for `trait Allocator`
Lee-Janggun Apr 14, 2025
31cb737
simd_select_bitmask: the 'padding' bits in the mask are just ignored
RalfJung Apr 19, 2025
3a372e3
std: mention `remove_dir_all` can emit `DirectoryNotEmpty` when concu…
xizheyin Apr 20, 2025
2422f0b
Restrict the cases where `ptr_eq` triggers (#14526)
Alexendoo Apr 22, 2025
ff428d9
Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into clippy-s…
flip1995 Apr 22, 2025
bf713a0
style: pull one more `if` into the let-chain
ada4a Apr 22, 2025
2304a9c
remove non-existent pathspec from pre-commit hook
ada4a Apr 22, 2025
aa27ae3
remove non-existent pathspec from pre-commit hook (#14671)
Manishearth Apr 22, 2025
dd5948c
Clippy: Fix doc issue
flip1995 Apr 23, 2025
36ae657
Document breaking out of a named code block
ktnlvr Apr 23, 2025
7c5312b
Reword `needless_question_mark` diagnostics and docs
Alexendoo Apr 23, 2025
dc695f5
Reword `needless_question_mark` diagnostics and docs (#14682)
Manishearth Apr 23, 2025
34f81f9
style: pull one more `if` into the let-chain (#14669)
y21 Apr 23, 2025
6e64338
Suggest {to,from}_ne_bytes for transmutations between arrays and inte…
bend-n Mar 31, 2025
6ee75c4
Remove `weak` alias terminology
BoxyUwU Apr 24, 2025
736be8b
Consistently refer to the `?` operator
Alexendoo Apr 24, 2025
fc12b5b
fix-issue-14665
Kivooeo Apr 22, 2025
91ed606
Consistently refer to the `?` operator (#14687)
y21 Apr 24, 2025
7b337f6
Replace some `Symbol::as_str` usage
Alexendoo Apr 23, 2025
8a9153d
Merge from rustc
Apr 25, 2025
2b8e9b5
Enable [behind-upstream] triagebot option
xizheyin Apr 25, 2025
148c9a1
Fix error message for static references or mutable references
yuk1ty Apr 20, 2025
3f72ffa
fix: `unnecessary_cast` suggests extra brackets when in macro
profetia Apr 17, 2025
ad69347
fix: `equatable_if_let` suggests wrongly when involving reference
profetia Mar 30, 2025
ff307ba
fix: `unnecessary_cast` suggests extra brackets when in macro (#14643)
Jarcho Apr 26, 2025
58cfdb7
fix: `equatable_if_let` suggests wrongly when involving reference (#1…
dswij Apr 26, 2025
39a4086
`manual_div_ceil`: fix suggestions when macro is involved (#14666)
dswij Apr 27, 2025
5d8fb77
fix: `unused_unit` suggests wrongly when unit never type fallback
profetia Apr 17, 2025
5123ad5
Fix `zombie_processes` FP inside closures
profetia Apr 27, 2025
0dd9722
Replace some `Symbol::as_str` usage (#14679)
y21 Apr 27, 2025
542762e
fix: `unused_unit` suggests wrongly when unit never type fallback (#1…
Jarcho Apr 27, 2025
451d73f
use repo name in push pr title
tshepang Apr 28, 2025
bca637c
Add or-patterns to pattern types
oli-obk Feb 27, 2025
92ba063
Rollup merge of #140249 - BoxyUwU:remove_weak_alias_terminology, r=ol…
GuillaumeGomez Apr 28, 2025
549107d
Fix `zombie_processes` FP inside closures (#14696)
Manishearth Apr 28, 2025
3d23917
Add an example of the example of an edition migration lint
ehuss Apr 28, 2025
b0e675b
Add documentation on how to migration the edition of the standard lib…
ehuss Apr 28, 2025
0aae3ca
Update mdbook to 0.4.48
ehuss Apr 28, 2025
5050037
Add documentation on how to stabilize the compiler edition
ehuss Apr 28, 2025
5ce6fa7
Merge pull request #2361 from ehuss/update-mdbook
JohnTitor Apr 29, 2025
c519510
Delay checking of `#[rustc_no_implicit_autorefs]` for reason
Urgau Apr 28, 2025
d172204
Merge from rustc
Apr 29, 2025
578ea26
mono collector: Reduce \# of locking while walking the graph
osiewicz Apr 29, 2025
c466cd0
Update compiler-src.md
smanilov Apr 29, 2025
820fce6
Some style nits
oli-obk Apr 29, 2025
a2b3f11
Filter out LoongArch features not supported by the current LLVM version
heiher Apr 29, 2025
74b55b4
Add comment to remind filtering unsupported features when adding new …
heiher Apr 29, 2025
9193dfe
Use a closure instead of three chained iterators
oli-obk Apr 29, 2025
6d58910
Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwU
tgross35 Apr 29, 2025
e2fb99c
Introduce a normalization chapter
BoxyUwU Apr 29, 2025
fcec80a
Merge pull request #2266 from BoxyUwU/normalization
lcnr Apr 29, 2025
7f1ae9b
Fix footnotes
BoxyUwU Apr 29, 2025
0f9146b
Merge pull request #2365 from BoxyUwU/norm_footnotes
BoxyUwU Apr 29, 2025
c7eeeb1
Merge PR #2360: Add docs about stabilizing an edition
traviscross Apr 29, 2025
029a2c4
Merge pull request #2363 from smanilov/patch-1
tshepang Apr 29, 2025
48bbf5a
for a more friendly output
tshepang Apr 29, 2025
146d8b9
Update to LLVM 20.1.4
nikic Apr 30, 2025
7135a9f
Merge pull request #2366 from rust-lang/tshepang-patch-1
jieyouxu Apr 30, 2025
b1c8693
Merge pull request #2359 from rust-lang/tshepang-repo-name
jieyouxu Apr 30, 2025
b02178b
Merge pull request #2352 from xizheyin/enable-behind-upstream
jieyouxu Apr 30, 2025
f293000
Use select in projection lookup
compiler-errors Apr 25, 2025
1157b78
Remove `avx512dq` and `avx512vl` implication for `avx512fp16`
sayantn Apr 18, 2025
adb92ae
rustc_target: Adjust RISC-V feature implication (Za64rs and Za128rs)
a4lg Apr 30, 2025
c6ed786
rustc_target: RISC-V: Add atomics/memory-related extensions
a4lg Apr 30, 2025
501a539
rustc_target: RISC-V: Add BF16 extensions
a4lg Apr 30, 2025
482ad5c
Remove redundant min-llvm-version annotations for LoongArch tests
heiher May 1, 2025
f27ba89
Update hashbrown dependency to unblock ExtractIf improvements
dtolnay May 1, 2025
3e0cbbb
adds 'with' to help clarify how to build a new compiler
martinomburajr May 1, 2025
27eb274
Preparing for merge from rustc
invalid-email-address May 1, 2025
560de7e
Merge from rustc
invalid-email-address May 1, 2025
9a3a212
adds commas
martinomburajr May 1, 2025
9ce6c52
Merge pull request #2368 from martinomburajr/master
tshepang May 1, 2025
bf06eaf
Merge pull request #2367 from rust-lang/rustc-pull
tshepang May 1, 2025
eec6cfb
rustc_target: RISC-V "Zfinx" is incompatible with {ILP32,LP64}[FD] ABIs
a4lg Mar 24, 2025
4379767
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 May 1, 2025
8a91bbf
Bump nightly version -> 2025-05-01
flip1995 May 1, 2025
03a5b6b
Rustup (#14721)
flip1995 May 1, 2025
c9992d6
Merge commit '03a5b6b976ac121f4233775c49a4bce026065b47' into clippy-s…
flip1995 May 1, 2025
3e969d4
Move core::fmt::Arguments::new_v1* to rt.rs.
m-ou-se May 1, 2025
36c6633
Clean up "const" situation in format_args!().
m-ou-se May 1, 2025
714ea10
rustdoc: Fix doctest heuristic for main fn wrapping
fmease Apr 29, 2025
ce50b4f
Bless mir opt tests.
m-ou-se May 1, 2025
86c6e79
Bless pretty tests.
m-ou-se May 1, 2025
60218be
Remove backtrace dep from anyhow in features status dump tool
LegNeato May 1, 2025
bfe3d54
User type annotations for free consts in pattern position
BoxyUwU May 1, 2025
72b110a
Stabilize `select_unpredictable`
Amanieu May 1, 2025
53e3907
No-op split into sub functions
BoxyUwU May 1, 2025
5d30814
allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`
folkertdev May 1, 2025
7443d03
Update stdarch
sayantn Apr 29, 2025
c1f2ad2
crashes: more tests
matthiaskrgr Apr 15, 2025
bc68d3a
Improve error output in case `nodejs` or `npm` is not installed for r…
GuillaumeGomez May 1, 2025
951412e
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef…
erickt May 1, 2025
238d113
Set groundwork for proper const normalization
BoxyUwU May 1, 2025
9ec8373
Crashes tests
BoxyUwU May 1, 2025
175f717
Simplify docs for breaking out of a named code block
ktnlvr May 1, 2025
17d74d6
Use present indicative tense in std::io::pipe() API docs
ebkalderon May 1, 2025
7b25d4a
extend the list of registered dylibs on `test::prepare_cargo_test`
onur-ozkan May 1, 2025
c02964f
Rollup merge of #138703 - pudongair:master, r=workingjubilee
GuillaumeGomez May 1, 2025
bd68c36
Rollup merge of #139186 - TDecking:float, r=workingjubilee
GuillaumeGomez May 1, 2025
931735a
Rollup merge of #139780 - ongardie:iterator-take-by_ref-example, r=wo…
GuillaumeGomez May 1, 2025
b867d20
Rollup merge of #139802 - Lee-Janggun:fix-allocate-hyperlink, r=worki…
GuillaumeGomez May 1, 2025
5a25a7a
Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=wor…
GuillaumeGomez May 1, 2025
5170e21
Rollup merge of #140062 - xizheyin:issue-139958, r=workingjubilee
GuillaumeGomez May 1, 2025
96faee4
Rollup merge of #140420 - fmease:rustdoc-fix-doctest-heur, r=Guillaum…
GuillaumeGomez May 1, 2025
9d7d782
Rollup merge of #140460 - heiher:issue-140455, r=Urgau
GuillaumeGomez May 1, 2025
786a53d
Rollup merge of #140538 - tshepang:rust-push, r=jieyouxu
GuillaumeGomez May 1, 2025
6cb75d8
Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-dead
GuillaumeGomez May 1, 2025
84ac890
Rollup merge of #140552 - folkertdev:naked-function-rustc_std_interna…
GuillaumeGomez May 1, 2025
d42e3ac
Rollup merge of #140556 - GuillaumeGomez:improve-rustdoc-gui-tool-err…
GuillaumeGomez May 1, 2025
b2bf951
Augment `impl-trait-missing-lifetime-gated.rs`.
nnethercote Mar 28, 2025
d42edee
Handle `Path<>` better in error messages.
nnethercote Apr 28, 2025
360012f
Amend language regarding the never type
Lynnesbian May 2, 2025
a3c78a3
Rollup merge of #130808 - checkraisefold:fix-questionmark-linking, r=…
VlaDexa May 2, 2025
3e01f97
Rollup merge of #134626 - veera-sivarajan:five-codegen-tests, r=Mark-…
VlaDexa May 2, 2025
bea05ce
Rollup merge of #135395 - saethlin:compiler-builtins-cgus, r=bjorn3
VlaDexa May 2, 2025
6dad7d2
Rollup merge of #136840 - Flakebi:linker-plugin-lto-fat, r=dianqk
VlaDexa May 2, 2025
9a69d6e
Rollup merge of #137474 - VlaDexa:shebang-placement, r=wesleywiser
VlaDexa May 2, 2025
4f6ea1b
Rollup merge of #138703 - pudongair:master, r=workingjubilee
VlaDexa May 2, 2025
1f0191f
Rollup merge of #138872 - a4lg:riscv-fix-incompatible-abi-zfinx, r=wo…
VlaDexa May 2, 2025
d4e9bfb
Rollup merge of #139046 - nnethercote:hir-Lifetime-better, r=lcnr
VlaDexa May 2, 2025
92f3146
Rollup merge of #139186 - TDecking:float, r=workingjubilee
VlaDexa May 2, 2025
e1900f8
Rollup merge of #139206 - joboet:unique_thread_errno, r=ibraheemdev
VlaDexa May 2, 2025
bfb7c70
Rollup merge of #139608 - Lynnesbian:improve-async-block-docs, r=ibra…
VlaDexa May 2, 2025
8a0b05c
Rollup merge of #139780 - ongardie:iterator-take-by_ref-example, r=wo…
VlaDexa May 2, 2025
2532a5c
Rollup merge of #139802 - Lee-Janggun:fix-allocate-hyperlink, r=worki…
VlaDexa May 2, 2025
7411639
Rollup merge of #139883 - matthiaskrgr:crashesapr15, r=Mark-Simulacrum
VlaDexa May 2, 2025
b18c0c3
Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=wor…
VlaDexa May 2, 2025
dd44b30
Rollup merge of #140062 - xizheyin:issue-139958, r=workingjubilee
VlaDexa May 2, 2025
5330e2c
Rollup merge of #140197 - ktnlvr:master, r=workingjubilee
VlaDexa May 2, 2025
bd46521
Rollup merge of #140389 - sayantn:avx512fp16, r=Amanieu
VlaDexa May 2, 2025
2af0b4c
Rollup merge of #140406 - Urgau:autorefs-perf, r=nnethercote
VlaDexa May 2, 2025
da58c50
Rollup merge of #140420 - fmease:rustdoc-fix-doctest-heur, r=Guillaum…
VlaDexa May 2, 2025
e78337e
Rollup merge of #140442 - osiewicz:collector-walk-less-fine-grained-l…
VlaDexa May 2, 2025
6fac03e
Rollup merge of #140460 - heiher:issue-140455, r=Urgau
VlaDexa May 2, 2025
ec64af1
Rollup merge of #140464 - oli-obk:successors-mut-perf, r=petrochenkov
VlaDexa May 2, 2025
366ca65
Rollup merge of #140502 - nikic:llvm-20.1.4, r=dianqk
VlaDexa May 2, 2025
f265e25
Rollup merge of #140507 - a4lg:riscv-feature-addition-batch-3, r=Amanieu
VlaDexa May 2, 2025
0cb4090
Rollup merge of #140519 - compiler-errors:name-based-comparison, r=ol…
VlaDexa May 2, 2025
1a39f0e
Rollup merge of #140534 - erickt:llvm-21, r=cuviper
VlaDexa May 2, 2025
12dba4c
Rollup merge of #140535 - dtolnay:hashbrown, r=tgross35
VlaDexa May 2, 2025
5348104
Rollup merge of #140538 - tshepang:rust-push, r=jieyouxu
VlaDexa May 2, 2025
6c4f7f6
Rollup merge of #140540 - flip1995:clippy-subtree-update, r=Manishearth
VlaDexa May 2, 2025
42be4df
Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, r=fee1-dead
VlaDexa May 2, 2025
8c4f6db
Rollup merge of #140546 - LegNeato:anyhowbacktrace, r=jieyouxu
VlaDexa May 2, 2025
dac957e
Rollup merge of #140548 - BoxyUwU:gci_patterns_user_ty_annotation, r=…
VlaDexa May 2, 2025
f04d5c4
Rollup merge of #140549 - BoxyUwU:proper_const_norm, r=lcnr
VlaDexa May 2, 2025
f6bd39a
Rollup merge of #140550 - Amanieu:stabilize_select_unpredictable, r=w…
VlaDexa May 2, 2025
64577cf
Rollup merge of #140552 - folkertdev:naked-function-rustc_std_interna…
VlaDexa May 2, 2025
d1f36e4
Rollup merge of #140556 - GuillaumeGomez:improve-rustdoc-gui-tool-err…
VlaDexa May 2, 2025
a46b711
Rollup merge of #140563 - onur-ozkan:extend-dylib-paths, r=jieyouxu
VlaDexa May 2, 2025
b19bd1b
Rollup merge of #140564 - ebkalderon:use-present-indicative-in-std-io…
VlaDexa May 2, 2025
5086b3e
Rollup merge of #140565 - GuillaumeGomez:rollup-gv4ed14, r=GuillaumeG…
VlaDexa May 2, 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
7 changes: 2 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ name = "anyhow"
version = "1.0.97"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
dependencies = [
"backtrace",
]

[[package]]
name = "ar_archive_writer"
Expand Down Expand Up @@ -1502,9 +1499,9 @@ dependencies = [

[[package]]
name = "hashbrown"
version = "0.15.2"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
dependencies = [
"allocator-api2",
"equivalent",
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ use rustc_errors::{DiagArgFromDisplay, DiagCtxtHandle, StashKey};
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
use rustc_hir::def_id::{CRATE_DEF_ID, LOCAL_CRATE, LocalDefId};
use rustc_hir::{
self as hir, ConstArg, GenericArg, HirId, ItemLocalMap, LangItem, LifetimeSource,
LifetimeSyntax, ParamName, TraitCandidate,
self as hir, AngleBrackets, ConstArg, GenericArg, HirId, ItemLocalMap, LangItem,
LifetimeSource, LifetimeSyntax, ParamName, TraitCandidate,
};
use rustc_index::{Idx, IndexSlice, IndexVec};
use rustc_macros::extension;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
match arg {
ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(
lt,
LifetimeSource::Path { with_angle_brackets: true },
LifetimeSource::Path { angle_brackets: hir::AngleBrackets::Full },
lt.ident.into(),
)),
ast::GenericArg::Type(ty) => {
Expand Down Expand Up @@ -1779,13 +1779,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
&mut self,
id: NodeId,
span: Span,
with_angle_brackets: bool,
angle_brackets: AngleBrackets,
) -> &'hir hir::Lifetime {
self.new_named_lifetime(
id,
id,
Ident::new(kw::UnderscoreLifetime, span),
LifetimeSource::Path { with_angle_brackets },
LifetimeSource::Path { angle_brackets },
LifetimeSyntax::Hidden,
)
}
Expand Down
30 changes: 17 additions & 13 deletions compiler/rustc_ast_lowering/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,27 +432,31 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

// Note: these spans are used for diagnostics when they can't be inferred.
// See rustc_resolve::late::lifetimes::LifetimeContext::add_missing_lifetime_specifiers_label
let (elided_lifetime_span, with_angle_brackets) = if generic_args.span.is_empty() {
// If there are no brackets, use the identifier span.
let (elided_lifetime_span, angle_brackets) = if generic_args.span.is_empty() {
// No brackets, e.g. `Path`: use an empty span just past the end of the identifier.
// HACK: we use find_ancestor_inside to properly suggest elided spans in paths
// originating from macros, since the segment's span might be from a macro arg.
(segment_ident_span.find_ancestor_inside(path_span).unwrap_or(path_span), false)
} else if generic_args.is_empty() {
// If there are brackets, but not generic arguments, then use the opening bracket
(generic_args.span.with_hi(generic_args.span.lo() + BytePos(1)), true)
(
segment_ident_span.find_ancestor_inside(path_span).unwrap_or(path_span),
hir::AngleBrackets::Missing,
)
} else {
// Else use an empty span right after the opening bracket.
(generic_args.span.with_lo(generic_args.span.lo() + BytePos(1)).shrink_to_lo(), true)
// Brackets, e.g. `Path<>` or `Path<T>`: use an empty span just after the `<`.
(
generic_args.span.with_lo(generic_args.span.lo() + BytePos(1)).shrink_to_lo(),
if generic_args.is_empty() {
hir::AngleBrackets::Empty
} else {
hir::AngleBrackets::Full
},
)
};

generic_args.args.insert_many(
0,
(start..end).map(|id| {
let l = self.lower_lifetime_hidden_in_path(
id,
elided_lifetime_span,
with_angle_brackets,
);
let l =
self.lower_lifetime_hidden_in_path(id, elided_lifetime_span, angle_brackets);
GenericArg::Lifetime(l)
}),
);
Expand Down
19 changes: 19 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ pub fn print_crate<'a>(
let mut s =
State { s: pp::Printer::new(), comments: Some(Comments::new(sm, filename, input)), ann };

// We need to print shebang before anything else
// otherwise the resulting code will not compile
// and shebang will be useless.
s.maybe_print_shebang();

if is_expanded && !krate.attrs.iter().any(|attr| attr.has_name(sym::no_core)) {
// We need to print `#![no_std]` (and its feature gate) so that
// compiling pretty-printed source won't inject libstd again.
Expand Down Expand Up @@ -560,6 +565,20 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
self.word(st)
}

fn maybe_print_shebang(&mut self) {
if let Some(cmnt) = self.peek_comment() {
// Comment is a shebang if it's:
// Isolated, starts with #! and doesn't continue with `[`
// See [rustc_lexer::strip_shebang] and [gather_comments] from pprust/state.rs for details
if cmnt.style == CommentStyle::Isolated
&& cmnt.lines.first().map_or(false, |l| l.starts_with("#!"))
{
let cmnt = self.next_comment().unwrap();
self.print_comment(cmnt);
}
}
}

fn print_inner_attributes(&mut self, attrs: &[ast::Attribute]) -> bool {
self.print_either_attributes(attrs, ast::AttrStyle::Inner, false, true)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ pub(crate) unsafe fn codegen(
"LLVM_module_codegen_make_bitcode",
&*module.name,
);
ThinBuffer::new(llmod, config.emit_thin_lto, false)
ThinBuffer::new(llmod, cgcx.lto != Lto::Fat && config.emit_thin_lto, false)
};
let data = thin.data();
let _timer = cgcx
Expand Down
6 changes: 6 additions & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
("aarch64", "fpmr") => None, // only existed in 18
("arm", "fp16") => Some(LLVMFeature::new("fullfp16")),
// Filter out features that are not supported by the current LLVM version
("loongarch64", "div32" | "lam-bh" | "lamcas" | "ld-seq-sa" | "scq")
if get_version().0 < 20 =>
{
None
}
// Filter out features that are not supported by the current LLVM version
("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
// Enable the evex512 target feature if an avx512 target feature is enabled.
("x86", s) if s.starts_with("avx512") => {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,9 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
}

let prefix = match &target.arch[..] {
"x86" | "x86_64" if target.is_like_msvc && undecorated.starts_with("?") => {
return undecorated;
}
"x86" => Some('_'),
"x86_64" => None,
"arm64ec" => Some('#'),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/check_consts/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ fn build_error_for_const_call<'tcx>(
);
err
}
_ if tcx.opt_parent(callee) == tcx.get_diagnostic_item(sym::ArgumentMethods) => {
_ if tcx.opt_parent(callee) == tcx.get_diagnostic_item(sym::FmtArgumentsNew) => {
ccx.dcx().create_err(errors::NonConstFmtMacroCall {
span,
kind: ccx.const_kind(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0207.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl<'a> Contains for Foo {
Please note that unconstrained lifetime parameters are not supported if they are
being used by an associated type.

In cases where the associated type's lifetime is meant to be tied to the the
In cases where the associated type's lifetime is meant to be tied to the
self type, and none of the methods on the trait need ownership or different
mutability, then an option is to implement the trait on a borrowed type:

Expand Down
29 changes: 20 additions & 9 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,24 @@ use crate::def_id::{DefId, LocalDefIdMap};
pub(crate) use crate::hir_id::{HirId, ItemLocalId, ItemLocalMap, OwnerId};
use crate::intravisit::{FnKind, VisitorExt};

#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable_Generic)]
pub enum AngleBrackets {
/// E.g. `Path`.
Missing,
/// E.g. `Path<>`.
Empty,
/// E.g. `Path<T>`.
Full,
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable_Generic)]
pub enum LifetimeSource {
/// E.g. `&Type`, `&'_ Type`, `&'a Type`, `&mut Type`, `&'_ mut Type`, `&'a mut Type`
Reference,

/// E.g. `ContainsLifetime`, `ContainsLifetime<'_>`, `ContainsLifetime<'a>`
Path {
/// - true for `ContainsLifetime<'_>`, `ContainsLifetime<'a>`,
/// `ContainsLifetime<'_, T>`, `ContainsLifetime<'a, T>`
/// - false for `ContainsLifetime`
with_angle_brackets: bool,
},
/// E.g. `ContainsLifetime`, `ContainsLifetime<>`, `ContainsLifetime<'_>`,
/// `ContainsLifetime<'a>`
Path { angle_brackets: AngleBrackets },

/// E.g. `impl Trait + '_`, `impl Trait + 'a`
OutlivesBound,
Expand Down Expand Up @@ -304,12 +310,17 @@ impl Lifetime {
(Named | Anonymous, _) => (self.ident.span, format!("{new_lifetime}")),

// The user wrote `Path<T>`, and omitted the `'_,`.
(Hidden, Path { with_angle_brackets: true }) => {
(Hidden, Path { angle_brackets: AngleBrackets::Full }) => {
(self.ident.span, format!("{new_lifetime}, "))
}

// The user wrote `Path<>`, and omitted the `'_`..
(Hidden, Path { angle_brackets: AngleBrackets::Empty }) => {
(self.ident.span, format!("{new_lifetime}"))
}

// The user wrote `Path` and omitted the `<'_>`.
(Hidden, Path { with_angle_brackets: false }) => {
(Hidden, Path { angle_brackets: AngleBrackets::Missing }) => {
(self.ident.span.shrink_to_hi(), format!("<{new_lifetime}>"))
}

Expand Down
25 changes: 17 additions & 8 deletions compiler/rustc_infer/src/infer/projection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use rustc_middle::traits::ObligationCause;
use rustc_middle::ty::{self, Ty};
use rustc_middle::ty;

use super::InferCtxt;
use crate::infer::Term;
use crate::traits::{Obligation, PredicateObligations};

impl<'tcx> InferCtxt<'tcx> {
Expand All @@ -11,24 +12,32 @@ impl<'tcx> InferCtxt<'tcx> {
/// of the given projection. This allows us to proceed with projections
/// while they cannot be resolved yet due to missing information or
/// simply due to the lack of access to the trait resolution machinery.
pub fn projection_ty_to_infer(
pub fn projection_term_to_infer(
&self,
param_env: ty::ParamEnv<'tcx>,
projection_ty: ty::AliasTy<'tcx>,
alias_term: ty::AliasTerm<'tcx>,
cause: ObligationCause<'tcx>,
recursion_depth: usize,
obligations: &mut PredicateObligations<'tcx>,
) -> Ty<'tcx> {
) -> Term<'tcx> {
debug_assert!(!self.next_trait_solver());
let ty_var = self.next_ty_var(self.tcx.def_span(projection_ty.def_id));

let span = self.tcx.def_span(alias_term.def_id);
let infer_var = if alias_term.kind(self.tcx).is_type() {
self.next_ty_var(span).into()
} else {
self.next_const_var(span).into()
};

let projection =
ty::PredicateKind::Clause(ty::ClauseKind::Projection(ty::ProjectionPredicate {
projection_term: projection_ty.into(),
term: ty_var.into(),
projection_term: alias_term,
term: infer_var,
}));
let obligation =
Obligation::with_depth(self.tcx, cause, recursion_depth, param_env, projection);
obligations.push(obligation);
ty_var

infer_var
}
}
15 changes: 11 additions & 4 deletions compiler/rustc_lint/src/autorefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitAutorefs {
_ => return,
},
ExprKind::Index(base, _, _) => base,
ExprKind::MethodCall(_, inner, _, _)
if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id)
&& cx.tcx.has_attr(def_id, sym::rustc_no_implicit_autorefs) =>
{
ExprKind::MethodCall(_, inner, _, _) => {
// PERF: Checking of `#[rustc_no_implicit_refs]` is deferred below
// because checking for attribute is a bit costly.
inner
}
ExprKind::Field(inner, _) => inner,
Expand All @@ -99,6 +98,14 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitAutorefs {
peel_place_mappers(inner).kind
// 1. Deref of a raw pointer.
&& typeck.expr_ty(dereferenced).is_raw_ptr()
// PERF: 5. b. A method call annotated with `#[rustc_no_implicit_refs]`
&& match expr.kind {
ExprKind::MethodCall(..) => matches!(
cx.typeck_results().type_dependent_def_id(expr.hir_id),
Some(def_id) if cx.tcx.has_attr(def_id, sym::rustc_no_implicit_autorefs)
),
_ => true,
}
{
cx.emit_span_lint(
DANGEROUS_IMPLICIT_AUTOREFS,
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,13 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
#endif
}

#if LLVM_VERSION_GE(21, 0)
TargetMachine *TM = TheTarget->createTargetMachine(Trip, CPU, Feature,
Options, RM, CM, OptLevel);
#else
TargetMachine *TM = TheTarget->createTargetMachine(
Trip.getTriple(), CPU, Feature, Options, RM, CM, OptLevel);
#endif
return wrap(TM);
}

Expand Down
Loading
Loading