Skip to content

Rollup of 8 pull requests #144285

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 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
00feedc
Add modern AVR mcus like avr128db28 and attiny3224
tomtor Jun 13, 2025
1323fd6
Add missing avr64* series
tomtor Jun 13, 2025
4e53043
populate the target_config now before its usage and update the test a…
Shourya742 Jul 18, 2025
5a5027a
Move float non determinism helpers to math.rs
LorrensP-2158466 Jul 7, 2025
a2586f0
tidy: running of eslint, tsc, and es-check are now an extra check
lolbinarycat Jun 23, 2025
4bd3b74
update CI to use new tidy extra checks for rustdoc js
lolbinarycat Jun 23, 2025
c8e2a65
tidy: use a lockfile for js tools instead of npx
lolbinarycat Jun 27, 2025
2ffa711
REUSE.toml: add new package.json and package-lock.json
lolbinarycat Jul 11, 2025
ca39010
update completions
lolbinarycat Jul 19, 2025
c6d50ea
integrate build_helper::npm into js checks and package.json usage
lolbinarycat Jul 19, 2025
258e410
Unquerify maybe_unused_trait_imports.
cjgillot Jul 3, 2025
725523e
tests: cover more `exported_private_dependencies` cases
mladedav Jul 16, 2025
4ca5afd
add default_lld_opt_in_targets method and modified test accordingly
Shourya742 Jul 18, 2025
fb10084
add test_lld_opt_in test
Shourya742 Jul 21, 2025
f391acb
Implement nondet behaviour and change/add tests.
LorrensP-2158466 Jul 7, 2025
a3e124f
Change stdlib float tests to account for miri nondet floats.
LorrensP-2158466 Jul 13, 2025
5290a8c
Rollup merge of #142454 - tomtor:avr-update, r=tgross35
matthiaskrgr Jul 22, 2025
a713d3c
Rollup merge of #142924 - lolbinarycat:tidy-js-extra-checks, r=Kobzol
matthiaskrgr Jul 22, 2025
0a48304
Rollup merge of #143373 - cjgillot:bare-unused-trait-imports, r=petro…
matthiaskrgr Jul 22, 2025
4a81583
Rollup merge of #143906 - LorrensP-2158466:miri-float-nondet-foreign-…
matthiaskrgr Jul 22, 2025
1bfd646
Rollup merge of #144082 - mladedav:dm/pub-priv-tests, r=petrochenkov
matthiaskrgr Jul 22, 2025
26435ec
Rollup merge of #144126 - Shourya742:2025-06-18-fix-target-config-iss…
matthiaskrgr Jul 22, 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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ __pycache__/

## Node
node_modules
package-lock.json
package.json
/src/doc/rustc-dev-guide/mermaid.min.js

## Rustdoc GUI tests
Expand Down
2 changes: 2 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ path = [
"rust-bors.toml",
"triagebot.toml",
"typos.toml",
"package.json",
"package-lock.json",
"x",
"x.ps1",
"x.py",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/check_unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(super) fn check_unused_traits(tcx: TyCtxt<'_>, (): ()) {
used_trait_imports.extend_unord(imports.items().copied());
}

for &id in tcx.maybe_unused_trait_imports(()) {
for &id in tcx.resolutions(()).maybe_unused_trait_imports.iter() {
debug_assert_eq!(tcx.def_kind(id), DefKind::Use);
if tcx.visibility(id).is_public() {
continue;
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,9 +2285,6 @@ rustc_queries! {
query upvars_mentioned(def_id: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
desc { |tcx| "collecting upvars mentioned in `{}`", tcx.def_path_str(def_id) }
}
query maybe_unused_trait_imports(_: ()) -> &'tcx FxIndexSet<LocalDefId> {
desc { "fetching potentially unused trait imports" }
}

/// All available crates in the graph, including those that should not be user-facing
/// (such as private crates).
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3428,8 +3428,6 @@ pub struct DeducedParamAttrs {
}

pub fn provide(providers: &mut Providers) {
providers.maybe_unused_trait_imports =
|tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
providers.extern_mod_stmt_cnum =
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
providers.is_panic_runtime =
Expand Down
67 changes: 67 additions & 0 deletions compiler/rustc_target/src/spec/base/avr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 {
"attiny1624" => elf::EF_AVR_ARCH_XMEGA3,
"attiny1626" => elf::EF_AVR_ARCH_XMEGA3,
"attiny1627" => elf::EF_AVR_ARCH_XMEGA3,
"attiny3224" => elf::EF_AVR_ARCH_XMEGA3,
"attiny3226" => elf::EF_AVR_ARCH_XMEGA3,
"attiny3227" => elf::EF_AVR_ARCH_XMEGA3,
"atmega808" => elf::EF_AVR_ARCH_XMEGA3,
"atmega809" => elf::EF_AVR_ARCH_XMEGA3,
"atmega1608" => elf::EF_AVR_ARCH_XMEGA3,
Expand All @@ -331,6 +334,70 @@ pub fn ef_avr_arch(target_cpu: &str) -> u32 {
"atmega4808" => elf::EF_AVR_ARCH_XMEGA3,
"atmega4809" => elf::EF_AVR_ARCH_XMEGA3,

"avr64da28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64da32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64da48" => elf::EF_AVR_ARCH_XMEGA2,
"avr64da64" => elf::EF_AVR_ARCH_XMEGA2,
"avr64db28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64db32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64db48" => elf::EF_AVR_ARCH_XMEGA2,
"avr64db64" => elf::EF_AVR_ARCH_XMEGA2,
"avr64dd14" => elf::EF_AVR_ARCH_XMEGA2,
"avr64dd20" => elf::EF_AVR_ARCH_XMEGA2,
"avr64dd28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64dd32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64du28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64du32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64ea28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64ea32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64ea48" => elf::EF_AVR_ARCH_XMEGA2,
"avr64sd28" => elf::EF_AVR_ARCH_XMEGA2,
"avr64sd32" => elf::EF_AVR_ARCH_XMEGA2,
"avr64sd48" => elf::EF_AVR_ARCH_XMEGA2,

"avr16dd20" => elf::EF_AVR_ARCH_XMEGA3,
"avr16dd28" => elf::EF_AVR_ARCH_XMEGA3,
"avr16dd32" => elf::EF_AVR_ARCH_XMEGA3,
"avr16du14" => elf::EF_AVR_ARCH_XMEGA3,
"avr16du20" => elf::EF_AVR_ARCH_XMEGA3,
"avr16du28" => elf::EF_AVR_ARCH_XMEGA3,
"avr16du32" => elf::EF_AVR_ARCH_XMEGA3,
"avr32da28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32da32" => elf::EF_AVR_ARCH_XMEGA3,
"avr32da48" => elf::EF_AVR_ARCH_XMEGA3,
"avr32db28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32db32" => elf::EF_AVR_ARCH_XMEGA3,
"avr32db48" => elf::EF_AVR_ARCH_XMEGA3,
"avr32dd14" => elf::EF_AVR_ARCH_XMEGA3,
"avr32dd20" => elf::EF_AVR_ARCH_XMEGA3,
"avr32dd28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32dd32" => elf::EF_AVR_ARCH_XMEGA3,
"avr32du14" => elf::EF_AVR_ARCH_XMEGA3,
"avr32du20" => elf::EF_AVR_ARCH_XMEGA3,
"avr32du28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32du32" => elf::EF_AVR_ARCH_XMEGA3,
"avr16eb14" => elf::EF_AVR_ARCH_XMEGA3,
"avr16eb20" => elf::EF_AVR_ARCH_XMEGA3,
"avr16eb28" => elf::EF_AVR_ARCH_XMEGA3,
"avr16eb32" => elf::EF_AVR_ARCH_XMEGA3,
"avr16ea28" => elf::EF_AVR_ARCH_XMEGA3,
"avr16ea32" => elf::EF_AVR_ARCH_XMEGA3,
"avr16ea48" => elf::EF_AVR_ARCH_XMEGA3,
"avr32ea28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32ea32" => elf::EF_AVR_ARCH_XMEGA3,
"avr32ea48" => elf::EF_AVR_ARCH_XMEGA3,
"avr32sd20" => elf::EF_AVR_ARCH_XMEGA3,
"avr32sd28" => elf::EF_AVR_ARCH_XMEGA3,
"avr32sd32" => elf::EF_AVR_ARCH_XMEGA3,
"avr128da28" => elf::EF_AVR_ARCH_XMEGA4,
"avr128da32" => elf::EF_AVR_ARCH_XMEGA4,
"avr128da48" => elf::EF_AVR_ARCH_XMEGA4,
"avr128da64" => elf::EF_AVR_ARCH_XMEGA4,
"avr128db28" => elf::EF_AVR_ARCH_XMEGA4,
"avr128db32" => elf::EF_AVR_ARCH_XMEGA4,
"avr128db48" => elf::EF_AVR_ARCH_XMEGA4,
"avr128db64" => elf::EF_AVR_ARCH_XMEGA4,

// Unknown target CPU => Unspecified/generic code
_ => 0,
}
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1936,8 +1936,8 @@ pub mod math {
/// let abs_difference_x = (f32::math::abs_sub(x, 1.0) - 2.0).abs();
/// let abs_difference_y = (f32::math::abs_sub(y, 1.0) - 0.0).abs();
///
/// assert!(abs_difference_x <= f32::EPSILON);
/// assert!(abs_difference_y <= f32::EPSILON);
/// assert!(abs_difference_x <= 1e-6);
/// assert!(abs_difference_y <= 1e-6);
/// ```
///
/// _This standalone function is for testing only.
Expand Down Expand Up @@ -1982,7 +1982,7 @@ pub mod math {
/// // x^(1/3) - 2 == 0
/// let abs_difference = (f32::math::cbrt(x) - 2.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
///
/// _This standalone function is for testing only.
Expand Down
30 changes: 15 additions & 15 deletions library/std/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ impl f32 {
/// let abs_difference_x = (x.abs_sub(1.0) - 2.0).abs();
/// let abs_difference_y = (y.abs_sub(1.0) - 0.0).abs();
///
/// assert!(abs_difference_x <= f32::EPSILON);
/// assert!(abs_difference_y <= f32::EPSILON);
/// assert!(abs_difference_x <= 1e-6);
/// assert!(abs_difference_y <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -621,7 +621,7 @@ impl f32 {
/// // x^(1/3) - 2 == 0
/// let abs_difference = (x.cbrt() - 2.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -652,7 +652,7 @@ impl f32 {
/// // sqrt(x^2 + y^2)
/// let abs_difference = (x.hypot(y) - (x.powi(2) + y.powi(2)).sqrt()).abs();
///
/// assert!(abs_difference <= 1e-6);
/// assert!(abs_difference <= 1e-5);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -725,7 +725,7 @@ impl f32 {
/// let x = std::f32::consts::FRAC_PI_4;
/// let abs_difference = (x.tan() - 1.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -813,7 +813,7 @@ impl f32 {
/// // atan(tan(1))
/// let abs_difference = (f.tan().atan() - 1.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[doc(alias = "arctan")]
#[rustc_allow_incoherent_impl]
Expand Down Expand Up @@ -854,8 +854,8 @@ impl f32 {
/// let abs_difference_1 = (y1.atan2(x1) - (-std::f32::consts::FRAC_PI_4)).abs();
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * std::f32::consts::FRAC_PI_4)).abs();
///
/// assert!(abs_difference_1 <= f32::EPSILON);
/// assert!(abs_difference_2 <= f32::EPSILON);
/// assert!(abs_difference_1 <= 1e-5);
/// assert!(abs_difference_2 <= 1e-5);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -982,7 +982,7 @@ impl f32 {
/// let g = ((e * e) - 1.0) / (2.0 * e);
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -1012,7 +1012,7 @@ impl f32 {
/// let abs_difference = (f - g).abs();
///
/// // Same result
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -1042,7 +1042,7 @@ impl f32 {
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -1095,7 +1095,7 @@ impl f32 {
///
/// let abs_difference = (f - x).abs();
///
/// assert!(abs_difference <= 1e-6);
/// assert!(abs_difference <= 1e-5);
/// ```
#[doc(alias = "arccosh")]
#[rustc_allow_incoherent_impl]
Expand Down Expand Up @@ -1125,7 +1125,7 @@ impl f32 {
///
/// let abs_difference = (f - e).abs();
///
/// assert!(abs_difference <= 1e-5);
/// assert!(abs_difference <= 1e-4);
/// ```
#[doc(alias = "arctanh")]
#[rustc_allow_incoherent_impl]
Expand Down Expand Up @@ -1153,7 +1153,7 @@ impl f32 {
///
/// let abs_difference = (x.gamma() - 24.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-4);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -1248,7 +1248,7 @@ impl f32 {
/// let one = x.erf() + x.erfc();
/// let abs_difference = (one - 1.0).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// assert!(abs_difference <= 1e-6);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ impl f64 {
///
/// let abs_difference = (x.gamma() - 24.0).abs();
///
/// assert!(abs_difference <= f64::EPSILON);
/// assert!(abs_difference <= 1e-13);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down Expand Up @@ -1248,7 +1248,7 @@ impl f64 {
/// let one = x.erf() + x.erfc();
/// let abs_difference = (one - 1.0).abs();
///
/// assert!(abs_difference <= f64::EPSILON);
/// assert!(abs_difference <= 1e-13);
/// ```
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
Expand Down
14 changes: 7 additions & 7 deletions library/std/tests/floats/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn test_log() {
let nan: f32 = f32::NAN;
let inf: f32 = f32::INFINITY;
let neg_inf: f32 = f32::NEG_INFINITY;
assert_approx_eq!(10.0f32.log(10.0), 1.0);
assert_approx_eq!(10.0f32.log(10.0), 1.0, APPROX_DELTA);
assert_approx_eq!(2.3f32.log(3.5), 0.664858);
assert_approx_eq!(1.0f32.exp().log(1.0f32.exp()), 1.0, APPROX_DELTA);
assert!(1.0f32.log(1.0).is_nan());
Expand Down Expand Up @@ -140,10 +140,10 @@ fn test_asinh() {
assert_approx_eq!(2.0f32.asinh(), 1.443635475178810342493276740273105f32);
assert_approx_eq!((-2.0f32).asinh(), -1.443635475178810342493276740273105f32);
// regression test for the catastrophic cancellation fixed in 72486
assert_approx_eq!((-3000.0f32).asinh(), -8.699514775987968673236893537700647f32);
assert_approx_eq!((-3000.0f32).asinh(), -8.699514775987968673236893537700647f32, APPROX_DELTA);

// test for low accuracy from issue 104548
assert_approx_eq!(60.0f32, 60.0f32.sinh().asinh());
assert_approx_eq!(60.0f32, 60.0f32.sinh().asinh(), APPROX_DELTA);
// mul needed for approximate comparison to be meaningful
assert_approx_eq!(1.0f32, 1e-15f32.sinh().asinh() * 1e15f32);
}
Expand Down Expand Up @@ -196,10 +196,10 @@ fn test_gamma() {
assert_approx_eq!(1.0f32.gamma(), 1.0f32);
assert_approx_eq!(2.0f32.gamma(), 1.0f32);
assert_approx_eq!(3.0f32.gamma(), 2.0f32);
assert_approx_eq!(4.0f32.gamma(), 6.0f32);
assert_approx_eq!(5.0f32.gamma(), 24.0f32);
assert_approx_eq!(4.0f32.gamma(), 6.0f32, APPROX_DELTA);
assert_approx_eq!(5.0f32.gamma(), 24.0f32, APPROX_DELTA);
assert_approx_eq!(0.5f32.gamma(), consts::PI.sqrt());
assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt());
assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt(), APPROX_DELTA);
assert_eq!(0.0f32.gamma(), f32::INFINITY);
assert_eq!((-0.0f32).gamma(), f32::NEG_INFINITY);
assert!((-1.0f32).gamma().is_nan());
Expand All @@ -218,7 +218,7 @@ fn test_ln_gamma() {
assert_eq!(2.0f32.ln_gamma().1, 1);
assert_approx_eq!(3.0f32.ln_gamma().0, 2.0f32.ln());
assert_eq!(3.0f32.ln_gamma().1, 1);
assert_approx_eq!((-0.5f32).ln_gamma().0, (2.0 * consts::PI.sqrt()).ln());
assert_approx_eq!((-0.5f32).ln_gamma().0, (2.0 * consts::PI.sqrt()).ln(), APPROX_DELTA);
assert_eq!((-0.5f32).ln_gamma().1, -1);
}

Expand Down
Loading
Loading