Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 59a81c2

Browse files
authored
Merge pull request rust-lang#594 from rust-lang/sync_from_rust_2025_01_12
Sync from rust 2025/01/12
2 parents f03d3c4 + 17f5a4f commit 59a81c2

25 files changed

+234
-1288
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
- { gcc: "gcc-13.deb" }
2323
- { gcc: "gcc-13-without-int128.deb" }
2424
commands: [
25-
"--mini-tests",
2625
"--std-tests",
2726
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
2827
# "--asm-tests",
@@ -79,6 +78,7 @@ jobs:
7978
run: |
8079
./y.sh prepare --only-libcore
8180
./y.sh build --sysroot
81+
./y.sh test --mini-tests
8282
cargo test
8383
8484
- name: Run y.sh cargo build

.github/workflows/m68k.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
commands: [
26-
"--mini-tests",
2726
"--std-tests",
2827
# TODO(antoyo): fix those on m68k.
2928
#"--test-libcore",
@@ -93,6 +92,7 @@ jobs:
9392
run: |
9493
./y.sh prepare --only-libcore --cross
9594
./y.sh build --sysroot --features compiler_builtins/no-f16-f128 --target-triple m68k-unknown-linux-gnu
95+
./y.sh test --mini-tests
9696
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test
9797
./y.sh clean all
9898

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
run: |
5555
./y.sh prepare --only-libcore
5656
EMBED_LTO_BITCODE=1 ./y.sh build --sysroot --release --release-sysroot
57+
./y.sh test --mini-tests
5758
cargo test
5859
./y.sh clean all
5960

.github/workflows/stdarch.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ jobs:
7373
echo "LD_LIBRARY_PATH="$(./y.sh info | grep -v Using) >> $GITHUB_ENV
7474
echo "LIBRARY_PATH="$(./y.sh info | grep -v Using) >> $GITHUB_ENV
7575
76-
- name: Build (part 2)
77-
run: |
78-
cargo test
79-
8076
- name: Clean
8177
if: ${{ !matrix.cargo_runner }}
8278
run: |
@@ -92,6 +88,7 @@ jobs:
9288
if: ${{ !matrix.cargo_runner }}
9389
run: |
9490
./y.sh test --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
91+
cargo test
9592
9693
- name: Run stdarch tests
9794
if: ${{ !matrix.cargo_runner }}

build_system/src/test.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,17 @@ fn contains_ui_error_patterns(file_path: &Path, keep_lto_tests: bool) -> Result<
848848
if line.is_empty() {
849849
continue;
850850
}
851-
if ["//@ error-pattern:", "//@ build-fail", "//@ run-fail", "-Cllvm-args", "//~", "thread"]
852-
.iter()
853-
.any(|check| line.contains(check))
851+
if [
852+
"//@ error-pattern:",
853+
"//@ build-fail",
854+
"//@ run-fail",
855+
"//@ known-bug",
856+
"-Cllvm-args",
857+
"//~",
858+
"thread",
859+
]
860+
.iter()
861+
.any(|check| line.contains(check))
854862
{
855863
return Ok(true);
856864
}
@@ -868,9 +876,14 @@ fn contains_ui_error_patterns(file_path: &Path, keep_lto_tests: bool) -> Result<
868876
return Ok(true);
869877
}
870878
}
871-
if file_path.display().to_string().contains("ambiguous-4-extern.rs") {
879+
let file_path = file_path.display().to_string();
880+
if file_path.contains("ambiguous-4-extern.rs") {
872881
eprintln!("nothing found for {file_path:?}");
873882
}
883+
// The files in this directory contain errors.
884+
if file_path.contains("/error-emitter/") {
885+
return Ok(true);
886+
}
874887
Ok(false)
875888
}
876889

example/mini_core.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ impl Add for usize {
170170
}
171171
}
172172

173+
impl Add for isize {
174+
type Output = Self;
175+
176+
fn add(self, rhs: Self) -> Self {
177+
self + rhs
178+
}
179+
}
180+
173181
#[lang = "sub"]
174182
pub trait Sub<RHS = Self> {
175183
type Output;

messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ codegen_gcc_lto_not_supported =
99
LTO is not supported. You may get a linker error.
1010
1111
codegen_gcc_forbidden_ctarget_feature =
12-
target feature `{$feature}` cannot be toggled with `-Ctarget-feature`
12+
target feature `{$feature}` cannot be toggled with `-Ctarget-feature`: {$reason}
1313
1414
codegen_gcc_unwinding_inline_asm =
1515
GCC backend does not support unwinding from inline asm

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-12-11"
2+
channel = "nightly-2025-01-12"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/asm.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,13 @@ impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
867867
template_str.push_str("\n.popsection");
868868
self.context.add_top_level_asm(None, &template_str);
869869
}
870+
871+
fn mangled_name(&self, instance: Instance<'tcx>) -> String {
872+
// TODO(@Amanieu): Additional mangling is needed on
873+
// some targets to add a leading underscore (Mach-O)
874+
// or byte count suffixes (x86 Windows).
875+
self.tcx.symbol_name(instance).name.to_string()
876+
}
870877
}
871878

872879
fn modifier_to_gcc(

src/attributes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
use gccjit::FnAttribute;
33
use gccjit::Function;
44
#[cfg(feature = "master")]
5-
use rustc_attr::InlineAttr;
6-
use rustc_attr::InstructionSetAttr;
5+
use rustc_attr_parsing::InlineAttr;
6+
use rustc_attr_parsing::InstructionSetAttr;
77
#[cfg(feature = "master")]
88
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
99
use rustc_middle::ty;
@@ -20,7 +20,7 @@ fn inline_attr<'gcc, 'tcx>(
2020
) -> Option<FnAttribute<'gcc>> {
2121
match inline {
2222
InlineAttr::Hint => Some(FnAttribute::Inline),
23-
InlineAttr::Always => Some(FnAttribute::AlwaysInline),
23+
InlineAttr::Always | InlineAttr::Force { .. } => Some(FnAttribute::AlwaysInline),
2424
InlineAttr::Never => {
2525
if cx.sess().target.arch != "amdgpu" {
2626
Some(FnAttribute::NoInline)

0 commit comments

Comments
 (0)