Skip to content

Rollup of 6 pull requests #139452

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

Merged
merged 21 commits into from
Apr 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
41b0465
Trusty: Implement write_vectored for stdio
thaliaarchi Mar 24, 2025
ed35b9b
Add `slice::align_to_uninit_mut`
nickkuk Mar 28, 2025
aff2bc7
Replace `rustc_lexer/unescape` with `rustc-literal-escaper` crate
GuillaumeGomez Apr 4, 2025
bba0d57
Remove usage of `rustc_lexer::unescape` in rust-analyzer
GuillaumeGomez Apr 4, 2025
13400c2
Add `_value` methods to proc_macro lib
GuillaumeGomez Apr 4, 2025
e649867
Optimize slice Iter::nth
kornelski Mar 16, 2025
89477af
Optimize slice Windows::nth
kornelski Mar 16, 2025
9f2f1aa
Optimize setting the slice to empty in slice Iter
kornelski Mar 16, 2025
2b533e6
bootstrap: Only add `rustc_randomized_layouts` if the crate has it
GuillaumeGomez Apr 4, 2025
2e3a161
Update `rustc-literal-escaper` version to `0.0.2`
GuillaumeGomez Apr 4, 2025
017e99b
Add `rustc-literal-escaper` to allowed crates lists
GuillaumeGomez Apr 4, 2025
6b5ccfc
check if merged attributes list is empty
TaKO8Ki Apr 4, 2025
66a2730
Fix Typo
Adamkob12 Apr 5, 2025
e31d1d5
format
Adamkob12 Apr 5, 2025
5797532
Clean up `rustc-literal-escaper` usage in rust-analyzer
GuillaumeGomez Apr 5, 2025
7bd89b9
Rollup merge of #138562 - kornelski:nth-panic, r=Noratrieb
GuillaumeGomez Apr 6, 2025
962fa98
Rollup merge of #138876 - thaliaarchi:trusty-stdio, r=Noratrieb
GuillaumeGomez Apr 6, 2025
d1da78b
Rollup merge of #139072 - nickkuk:align_to_uninit_mut, r=Mark-Simulacrum
GuillaumeGomez Apr 6, 2025
ed81e34
Rollup merge of #139367 - GuillaumeGomez:proc-macro-values, r=Urgau
GuillaumeGomez Apr 6, 2025
b1d67b2
Rollup merge of #139391 - TaKO8Ki:check-if-merged-attrs-list-is-empty…
GuillaumeGomez Apr 6, 2025
b3e051a
Rollup merge of #139414 - Adamkob12:fix_typo_raw_list, r=Nadrieril
GuillaumeGomez Apr 6, 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
10 changes: 9 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3150,6 +3150,12 @@ version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"

[[package]]
name = "rustc-literal-escaper"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0041b6238913c41fe704213a4a9329e2f685a156d1781998128b4149c230ad04"

[[package]]
name = "rustc-main"
version = "0.0.0"
Expand Down Expand Up @@ -3242,10 +3248,10 @@ version = "0.0.0"
dependencies = [
"bitflags",
"memchr",
"rustc-literal-escaper",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_index",
"rustc_lexer",
"rustc_macros",
"rustc_serialize",
"rustc_span",
Expand Down Expand Up @@ -4200,6 +4206,7 @@ name = "rustc_parse"
version = "0.0.0"
dependencies = [
"bitflags",
"rustc-literal-escaper",
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
Expand All @@ -4222,6 +4229,7 @@ dependencies = [
name = "rustc_parse_format"
version = "0.0.0"
dependencies = [
"rustc-literal-escaper",
"rustc_index",
"rustc_lexer",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ edition = "2024"
# tidy-alphabetical-start
bitflags = "2.4.1"
memchr = "2.7.4"
rustc-literal-escaper = "0.0.2"
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_index = { path = "../rustc_index" }
rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/util/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::{ascii, fmt, str};

use rustc_lexer::unescape::{
use rustc_literal_escaper::{
MixedUnit, Mode, byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode,
};
use rustc_span::{Span, Symbol, kw, sym};
Expand Down
16 changes: 9 additions & 7 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ impl<'hir> LoweringContext<'_, 'hir> {
// Merge attributes into the inner expression.
if !e.attrs.is_empty() {
let old_attrs = self.attrs.get(&ex.hir_id.local_id).copied().unwrap_or(&[]);
self.attrs.insert(
ex.hir_id.local_id,
&*self.arena.alloc_from_iter(
self.lower_attrs_vec(&e.attrs, e.span)
.into_iter()
.chain(old_attrs.iter().cloned()),
),
let attrs = &*self.arena.alloc_from_iter(
self.lower_attrs_vec(&e.attrs, e.span)
.into_iter()
.chain(old_attrs.iter().cloned()),
);
if attrs.is_empty() {
return ex;
}

self.attrs.insert(ex.hir_id.local_id, attrs);
}
return ex;
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
// tidy-alphabetical-end

mod cursor;
pub mod unescape;

#[cfg(test)]
mod tests;
Expand Down
Loading
Loading