Skip to content
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

Rollup of 17 pull requests #138325

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
547eaca
Convert `ShardedHashMap` to use `hashbrown::HashTable`
cuviper Feb 27, 2025
01795b1
change definitely non-productive cycles to error
lcnr Feb 27, 2025
18809a2
keep inductive cycles as ambig in coherence
lcnr Feb 28, 2025
36efaf8
normalize away `-Wlinker-messages` wrappers from `rust-lld` rmake test
lqd Mar 5, 2025
b2de19e
Update bootstrap to edition 2024
Kobzol Feb 25, 2025
6a38322
Rename print_something to should_render
compiler-errors Mar 5, 2025
279377f
Fix pretty printing of parsed attrs in hir_pretty
compiler-errors Mar 5, 2025
f525b17
Remove AdtFlags::IS_ANONYMOUS and Copy/Clone condition for anonymous ADT
compiler-errors Mar 10, 2025
b827087
add tracking issue for unqualified_local_imports
RalfJung Mar 10, 2025
02bb2d4
Disable CFI for weakly linked syscalls
1c3t3a Mar 4, 2025
e5dc1e3
Add comments for #[no_sanitize(cfi)] in stdlib
1c3t3a Mar 10, 2025
fb9ce02
Limit formatting width and precision to 16 bits.
m-ou-se Feb 12, 2025
4374d54
Update tests.
m-ou-se Feb 12, 2025
ce512c2
Fix rust-analyzer for 16-bit fmt width and precision.
m-ou-se Feb 12, 2025
7677567
Remove unnecessary semicolon.
m-ou-se Feb 28, 2025
2647cf1
Add #[track_caller] to from_usize.
m-ou-se Feb 28, 2025
7ca7675
Make all keys explicit in citool
Kobzol Feb 27, 2025
112f7b0
make precise capturing args in rustdoc Json typed
Kohei316 Mar 2, 2025
0412507
Move job handling to a separate module
Kobzol Mar 10, 2025
2ce0205
Share implementation of expr_u{16,32,size}.
m-ou-se Mar 10, 2025
3326a9f
Allow using glob aliases for custom try jobs
Kobzol Mar 10, 2025
06d86cd
Modify try-job documentation
Kobzol Mar 10, 2025
dfef1a7
Handle backticks in try job patterns
Kobzol Mar 10, 2025
16c08f6
Ignore job duplicates
Kobzol Mar 10, 2025
bf58a35
stabilize `ci_rustc_if_unchanged_logic` test for local environments
onur-ozkan Mar 8, 2025
32e0ce2
remove rls support from bootstrap
onur-ozkan Mar 10, 2025
733cbb5
remove rls specific parts from tidy and build-manifest
onur-ozkan Mar 10, 2025
91f8a40
remove rls source from the repository
onur-ozkan Mar 10, 2025
a657aeb
add change entry for rls removal
onur-ozkan Mar 10, 2025
5d4ff50
Update books
rustbot Mar 10, 2025
dcf6137
use next_back() instead of last() on DoubleEndedIterator
matthiaskrgr Mar 10, 2025
e337d87
Add powerpc64le maintainers
daltenty Mar 7, 2025
d75c973
main.js: insertAfter needs non-root referenceNode
lolbinarycat Mar 10, 2025
93161f5
main.js: don't set mouseMovedAfterSearch, as it is never read
lolbinarycat Mar 10, 2025
cf7f3cf
main.js: give type signatures to a few helper functions
lolbinarycat Mar 10, 2025
da5da99
main.js: handleEscape and handleShortcut accept KeyboardEvent
lolbinarycat Mar 10, 2025
6622111
main.js: always refer to searchState through window.searchState
lolbinarycat Mar 10, 2025
f5efd2a
main.js(isDisplayed): coerce truthy values to boolean
lolbinarycat Mar 10, 2025
ab180c2
main.js: handle document.activeElement being null
lolbinarycat Mar 10, 2025
2e1c8f0
rustdoc.d.ts: window.SIDEBAR_ITEMS may exist.
lolbinarycat Mar 10, 2025
749b6bf
rustdoc.d.ts: add window.{register_implementors,pending_implementors}
lolbinarycat Mar 10, 2025
7421546
main.js: typecheck things related to window.register_type_impls
lolbinarycat Mar 10, 2025
20bac26
main.js: remove searchState from globals.
lolbinarycat Mar 10, 2025
fb3d9ce
Rollup merge of #126856 - onur-ozkan:remove-rls, r=clubby789
jieyouxu Mar 10, 2025
12f29ff
Rollup merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcm
jieyouxu Mar 10, 2025
4e80159
Rollup merge of #137314 - lcnr:cycles-with-unknown-kind, r=compiler-e…
jieyouxu Mar 10, 2025
5923d2c
Rollup merge of #137612 - Kobzol:bootstrap-2024, r=onur-ozkan
jieyouxu Mar 10, 2025
5763e83
Rollup merge of #137701 - cuviper:sharded-hashtable, r=fmease
jieyouxu Mar 10, 2025
002b97a
Rollup merge of #138002 - 1c3t3a:fix-std-cfi-violation, r=rcvalle
jieyouxu Mar 10, 2025
4cbf318
Rollup merge of #138052 - lqd:lld-linker-messages, r=jieyouxu
jieyouxu Mar 10, 2025
de3720b
Rollup merge of #138063 - compiler-errors:improve-attr-unpretty, r=jd…
jieyouxu Mar 10, 2025
caf177d
Rollup merge of #138109 - Kohei316:feat/rust-doc-precise-capturing-ar…
jieyouxu Mar 10, 2025
41fc858
Rollup merge of #138147 - daltenty:patch-1, r=jieyouxu
jieyouxu Mar 10, 2025
f6b7134
Rollup merge of #138245 - onur-ozkan:ci-rustc-test-fix, r=jieyouxu
jieyouxu Mar 10, 2025
7956fc6
Rollup merge of #138296 - compiler-errors:deanonymous, r=lcnr
jieyouxu Mar 10, 2025
1a275d7
Rollup merge of #138300 - RalfJung:unqualified-local-imports, r=jieyouxu
jieyouxu Mar 10, 2025
8d3416e
Rollup merge of #138307 - Kobzol:citool-alias, r=marcoieni
jieyouxu Mar 10, 2025
4cbeefb
Rollup merge of #138313 - rustbot:docs-update, r=ehuss
jieyouxu Mar 10, 2025
7742eda
Rollup merge of #138315 - matthiaskrgr:nextback, r=fmease
jieyouxu Mar 10, 2025
0b4f8df
Rollup merge of #138318 - lolbinarycat:rustdoc-js-less-expect-error-p…
jieyouxu Mar 10, 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
9 changes: 2 additions & 7 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,7 @@ version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
dependencies = [
"allocator-api2",
"foldhash",
"serde",
]
Expand Down Expand Up @@ -3044,13 +3045,6 @@ dependencies = [
"serde",
]

[[package]]
name = "rls"
version = "2.0.0"
dependencies = [
"serde_json",
]

[[package]]
name = "run_make_support"
version = "0.2.0"
Expand Down Expand Up @@ -3492,6 +3486,7 @@ dependencies = [
"either",
"elsa",
"ena",
"hashbrown 0.15.2",
"indexmap",
"jobserver",
"libc",
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ members = [
"src/tools/remote-test-server",
"src/tools/rust-installer",
"src/tools/rustdoc",
"src/tools/rls",
"src/tools/rustfmt",
"src/tools/miri",
"src/tools/miri/cargo-miri",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ pub enum FormatAlignment {
#[derive(Clone, Encodable, Decodable, Debug, PartialEq, Eq)]
pub enum FormatCount {
/// `{:5}` or `{:.5}`
Literal(usize),
Literal(u16),
/// `{:.*}`, `{:.5$}`, or `{:a$}`, etc.
Argument(FormatArgPosition),
}
24 changes: 11 additions & 13 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2130,26 +2130,24 @@ impl<'hir> LoweringContext<'_, 'hir> {
self.arena.alloc(self.expr(sp, hir::ExprKind::Tup(&[])))
}

pub(super) fn expr_usize(&mut self, sp: Span, value: usize) -> hir::Expr<'hir> {
fn expr_uint(&mut self, sp: Span, ty: ast::UintTy, value: u128) -> hir::Expr<'hir> {
let lit = self.arena.alloc(hir::Lit {
span: sp,
node: ast::LitKind::Int(
(value as u128).into(),
ast::LitIntType::Unsigned(ast::UintTy::Usize),
),
node: ast::LitKind::Int(value.into(), ast::LitIntType::Unsigned(ty)),
});
self.expr(sp, hir::ExprKind::Lit(lit))
}

pub(super) fn expr_usize(&mut self, sp: Span, value: usize) -> hir::Expr<'hir> {
self.expr_uint(sp, ast::UintTy::Usize, value as u128)
}

pub(super) fn expr_u32(&mut self, sp: Span, value: u32) -> hir::Expr<'hir> {
let lit = self.arena.alloc(hir::Lit {
span: sp,
node: ast::LitKind::Int(
u128::from(value).into(),
ast::LitIntType::Unsigned(ast::UintTy::U32),
),
});
self.expr(sp, hir::ExprKind::Lit(lit))
self.expr_uint(sp, ast::UintTy::U32, value as u128)
}

pub(super) fn expr_u16(&mut self, sp: Span, value: u16) -> hir::Expr<'hir> {
self.expr_uint(sp, ast::UintTy::U16, value as u128)
}

pub(super) fn expr_char(&mut self, sp: Span, value: char) -> hir::Expr<'hir> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ fn make_count<'hir>(
hir::LangItem::FormatCount,
sym::Is,
));
let value = ctx.arena.alloc_from_iter([ctx.expr_usize(sp, *n)]);
let value = ctx.arena.alloc_from_iter([ctx.expr_u16(sp, *n)]);
ctx.expr_call_mut(sp, count_is, value)
}
Some(FormatCount::Argument(arg)) => {
Expand Down
52 changes: 30 additions & 22 deletions compiler/rustc_attr_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,39 @@ pub trait HashStableContext: rustc_ast::HashStableContext + rustc_abi::HashStabl
/// like [`Span`]s and empty tuples, are gracefully skipped so they don't clutter the
/// representation much.
pub trait PrintAttribute {
fn print_something(&self) -> bool;
/// Whether or not this will render as something meaningful, or if it's skipped
/// (which will force the containing struct to also skip printing a comma
/// and the field name).
fn should_render(&self) -> bool;

fn print_attribute(&self, p: &mut Printer);
}

impl<T: PrintAttribute> PrintAttribute for &T {
fn print_something(&self) -> bool {
T::print_something(self)
fn should_render(&self) -> bool {
T::should_render(self)
}

fn print_attribute(&self, p: &mut Printer) {
T::print_attribute(self, p)
}
}
impl<T: PrintAttribute> PrintAttribute for Option<T> {
fn print_something(&self) -> bool {
self.as_ref().is_some_and(|x| x.print_something())
fn should_render(&self) -> bool {
self.as_ref().is_some_and(|x| x.should_render())
}

fn print_attribute(&self, p: &mut Printer) {
if let Some(i) = self {
T::print_attribute(i, p)
}
}
}
impl<T: PrintAttribute> PrintAttribute for ThinVec<T> {
fn print_something(&self) -> bool {
self.is_empty() || self[0].print_something()
fn should_render(&self) -> bool {
self.is_empty() || self[0].should_render()
}

fn print_attribute(&self, p: &mut Printer) {
let mut last_printed = false;
p.word("[");
Expand All @@ -70,15 +76,15 @@ impl<T: PrintAttribute> PrintAttribute for ThinVec<T> {
p.word_space(",");
}
i.print_attribute(p);
last_printed = i.print_something();
last_printed = i.should_render();
}
p.word("]");
}
}
macro_rules! print_skip {
($($t: ty),* $(,)?) => {$(
impl PrintAttribute for $t {
fn print_something(&self) -> bool { false }
fn should_render(&self) -> bool { false }
fn print_attribute(&self, _: &mut Printer) { }
})*
};
Expand All @@ -87,7 +93,7 @@ macro_rules! print_skip {
macro_rules! print_disp {
($($t: ty),* $(,)?) => {$(
impl PrintAttribute for $t {
fn print_something(&self) -> bool { true }
fn should_render(&self) -> bool { true }
fn print_attribute(&self, p: &mut Printer) {
p.word(format!("{}", self));
}
Expand All @@ -97,7 +103,7 @@ macro_rules! print_disp {
macro_rules! print_debug {
($($t: ty),* $(,)?) => {$(
impl PrintAttribute for $t {
fn print_something(&self) -> bool { true }
fn should_render(&self) -> bool { true }
fn print_attribute(&self, p: &mut Printer) {
p.word(format!("{:?}", self));
}
Expand All @@ -106,37 +112,39 @@ macro_rules! print_debug {
}

macro_rules! print_tup {
(num_print_something $($ts: ident)*) => { 0 $(+ $ts.print_something() as usize)* };
(num_should_render $($ts: ident)*) => { 0 $(+ $ts.should_render() as usize)* };
() => {};
($t: ident $($ts: ident)*) => {
#[allow(non_snake_case, unused)]
impl<$t: PrintAttribute, $($ts: PrintAttribute),*> PrintAttribute for ($t, $($ts),*) {
fn print_something(&self) -> bool {
fn should_render(&self) -> bool {
let ($t, $($ts),*) = self;
print_tup!(num_print_something $t $($ts)*) != 0
print_tup!(num_should_render $t $($ts)*) != 0
}

fn print_attribute(&self, p: &mut Printer) {
let ($t, $($ts),*) = self;
let parens = print_tup!(num_print_something $t $($ts)*) > 1;
let parens = print_tup!(num_should_render $t $($ts)*) > 1;
if parens {
p.word("(");
p.popen();
}

let mut printed_anything = $t.print_something();
let mut printed_anything = $t.should_render();

$t.print_attribute(p);

$(
if printed_anything && $ts.print_something() {
p.word_space(",");
if $ts.should_render() {
if printed_anything {
p.word_space(",");
}
printed_anything = true;
}
$ts.print_attribute(p);
)*

if parens {
p.word(")");
p.pclose();
}
}
}
Expand All @@ -147,8 +155,8 @@ macro_rules! print_tup {

print_tup!(A B C D E F G H);
print_skip!(Span, ());
print_disp!(Symbol, u16, bool, NonZero<u32>);
print_debug!(UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);
print_disp!(u16, bool, NonZero<u32>);
print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);

/// Finds attributes in sequences of attributes by pattern matching.
///
Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ thin-vec = "0.2.12"
tracing = "0.1"
# tidy-alphabetical-end

[dependencies.hashbrown]
version = "0.15.2"
default-features = false
features = ["nightly"] # for may_dangle

[dependencies.parking_lot]
version = "0.12"

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#![feature(dropck_eyepatch)]
#![feature(extend_one)]
#![feature(file_buffered)]
#![feature(hash_raw_entry)]
#![feature(macro_metavar_expr)]
#![feature(map_try_insert)]
#![feature(min_specialization)]
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_data_structures/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl_dyn_send!(
[crate::sync::RwLock<T> where T: DynSend]
[crate::tagged_ptr::TaggedRef<'a, P, T> where 'a, P: Sync, T: Send + crate::tagged_ptr::Tag]
[rustc_arena::TypedArena<T> where T: DynSend]
[hashbrown::HashTable<T> where T: DynSend]
[indexmap::IndexSet<V, S> where V: DynSend, S: DynSend]
[indexmap::IndexMap<K, V, S> where K: DynSend, V: DynSend, S: DynSend]
[thin_vec::ThinVec<T> where T: DynSend]
Expand Down Expand Up @@ -153,6 +154,7 @@ impl_dyn_sync!(
[crate::tagged_ptr::TaggedRef<'a, P, T> where 'a, P: Sync, T: Sync + crate::tagged_ptr::Tag]
[parking_lot::lock_api::Mutex<R, T> where R: DynSync, T: ?Sized + DynSend]
[parking_lot::lock_api::RwLock<R, T> where R: DynSync, T: ?Sized + DynSend + DynSync]
[hashbrown::HashTable<T> where T: DynSync]
[indexmap::IndexSet<V, S> where V: DynSync, S: DynSync]
[indexmap::IndexMap<K, V, S> where K: DynSync, V: DynSync, S: DynSync]
[smallvec::SmallVec<A> where A: smallvec::Array + DynSync]
Expand Down
Loading
Loading