Skip to content

Rollup of 9 pull requests #143147

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 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1bbabb7
std::net: adding `unix_socket_exclbind` feature for solaris/illumos.
devnexen Apr 4, 2024
f3383e4
Do not include NUL-terminator in computed length
Darksonn Jun 12, 2025
6a1b7df
Use a NonNull pointer
Darksonn Jun 23, 2025
e0f8e86
Skip unnecessary components in x64 try builds
Kobzol Jun 24, 2025
25dee4e
Skip more dist components
Kobzol Jun 24, 2025
8034154
Do not build GCC in fast try builds
Kobzol Jun 24, 2025
58bc1dc
Remove `mut`
Kobzol Jun 25, 2025
508021a
Add windows-gnullvm hosts to the manifest
mati865 Jun 25, 2025
b2be01c
rustdoc: show attributes on enum variants
lolbinarycat Jun 24, 2025
7a79454
update internal `send_signal` comment
fee1-dead Jun 27, 2025
cd1713e
BTreeSet: remove duplicated code by reusing `from_sorted_iter`
xu-cheng Jun 27, 2025
9090199
Update ui.rs
leopardracer Jun 27, 2025
3a34dac
Update README.md
leopardracer Jun 27, 2025
39092cc
Update dangling_pointer_to_raw_pointer.rs
leopardracer Jun 27, 2025
00b64f8
Use tidy to sort `sym::*` items
yotamofek Jun 27, 2025
a7964a5
Rollup merge of #123476 - devnexen:std_net_solaris_exclbind, r=Mark-S…
matthiaskrgr Jun 28, 2025
7df2579
Rollup merge of #142708 - Darksonn:location-len-without-nul, r=Mark-S…
matthiaskrgr Jun 28, 2025
487d89a
Rollup merge of #142963 - Kobzol:try-build-skip, r=jieyouxu
matthiaskrgr Jun 28, 2025
59567c5
Rollup merge of #142987 - lolbinarycat:rustdoc-non_exhaustive-enum-v-…
matthiaskrgr Jun 28, 2025
370c89a
Rollup merge of #143031 - mati865:push-mutywntmvomx, r=Mark-Simulacrum
matthiaskrgr Jun 28, 2025
87b42e2
Rollup merge of #143082 - fee1-dead-contrib:push-qvvppzukvkxt, r=Mark…
matthiaskrgr Jun 28, 2025
f960b30
Rollup merge of #143110 - yotamofek:pr/tidy-sort-for-symbols, r=nneth…
matthiaskrgr Jun 28, 2025
09384b9
Rollup merge of #143111 - xu-cheng:btreeset_from_iter, r=Mark-Simulacrum
matthiaskrgr Jun 28, 2025
6991c5a
Rollup merge of #143114 - leopardracer:master, r=RalfJung
matthiaskrgr Jun 28, 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
12 changes: 5 additions & 7 deletions compiler/rustc_const_eval/src/util/caller_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ fn alloc_caller_location<'tcx>(
assert!(!filename.as_str().as_bytes().contains(&0));

let loc_details = ecx.tcx.sess.opts.unstable_opts.location_detail;
let file_wide_ptr = {
let filename = {
let filename = if loc_details.file { filename.as_str() } else { "<redacted>" };
let filename_with_nul = filename.to_owned() + "\0";
// This can fail if rustc runs out of memory right here. Trying to emit an error would be
// pointless, since that would require allocating more memory than these short strings.
let file_ptr = ecx.allocate_bytes_dedup(filename_with_nul.as_bytes()).unwrap();
Immediate::new_slice(file_ptr.into(), filename_with_nul.len().try_into().unwrap(), ecx)
let file_len = u64::try_from(filename.len()).unwrap();
Immediate::new_slice(file_ptr.into(), file_len, ecx)
};
let line = if loc_details.line { Scalar::from_u32(line) } else { Scalar::from_u32(0) };
let col = if loc_details.column { Scalar::from_u32(col) } else { Scalar::from_u32(0) };
Expand All @@ -41,11 +42,8 @@ fn alloc_caller_location<'tcx>(
let location = ecx.allocate(loc_layout, MemoryKind::CallerLocation).unwrap();

// Initialize fields.
ecx.write_immediate(
file_wide_ptr,
&ecx.project_field(&location, FieldIdx::from_u32(0)).unwrap(),
)
.expect("writing to memory we just allocated cannot fail");
ecx.write_immediate(filename, &ecx.project_field(&location, FieldIdx::from_u32(0)).unwrap())
.expect("writing to memory we just allocated cannot fail");
ecx.write_scalar(line, &ecx.project_field(&location, FieldIdx::from_u32(1)).unwrap())
.expect("writing to memory we just allocated cannot fail");
ecx.write_scalar(col, &ecx.project_field(&location, FieldIdx::from_u32(2)).unwrap())
Expand Down
12 changes: 0 additions & 12 deletions compiler/rustc_macros/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,6 @@ fn symbols_with_errors(input: TokenStream) -> (TokenStream, Vec<syn::Error>) {
let mut symbols_stream = quote! {};
let mut prefill_stream = quote! {};
let mut entries = Entries::with_capacity(input.keywords.len() + input.symbols.len() + 10);
let mut prev_key: Option<(Span, String)> = None;

let mut check_order = |span: Span, s: &str, errors: &mut Errors| {
if let Some((prev_span, ref prev_str)) = prev_key {
if s < prev_str {
errors.error(span, format!("Symbol `{s}` must precede `{prev_str}`"));
errors.error(prev_span, format!("location of previous symbol `{prev_str}`"));
}
}
prev_key = Some((span, s.to_string()));
};

// Generate the listed keywords.
for keyword in input.keywords.iter() {
Expand All @@ -219,7 +208,6 @@ fn symbols_with_errors(input: TokenStream) -> (TokenStream, Vec<syn::Error>) {
// Generate the listed symbols.
for symbol in input.symbols.iter() {
let name = &symbol.name;
check_order(symbol.name.span(), &name.to_string(), &mut errors);

let value = match &symbol.value {
Value::SameAsName => name.to_string(),
Expand Down
15 changes: 0 additions & 15 deletions compiler/rustc_macros/src/symbols/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,3 @@ fn check_dup_symbol_and_keyword() {
};
test_symbols_macro(input, &["Symbol `splat` is duplicated", "location of previous definition"]);
}

#[test]
fn check_symbol_order() {
let input = quote! {
Keywords {}
Symbols {
zebra,
aardvark,
}
};
test_symbols_macro(
input,
&["Symbol `aardvark` must precede `zebra`", "location of previous symbol `zebra`"],
);
}
Loading
Loading