Rollup merge of #118973 - Enselic:fix-IncorrectCguReuseType, r=michaelwoerister
rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work In [100753], `IncorrectCguReuseType` accidentally stopped being emitted by removing `diag.span_err(...)`. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly. We assume that there are no bugs and that the currently actual CGU reuse is correct. If there are bugs, they will be discovered and fixed eventually, and the tests will then be updated. [100753]: https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84 Closes #118972
This commit is contained in:
commit
df4d56307b
4 changed files with 16 additions and 12 deletions
|
@ -278,13 +278,13 @@ impl CguReuseTracker {
|
||||||
|
|
||||||
if error {
|
if error {
|
||||||
let at_least = if at_least { 1 } else { 0 };
|
let at_least = if at_least { 1 } else { 0 };
|
||||||
errors::IncorrectCguReuseType {
|
sess.emit_err(errors::IncorrectCguReuseType {
|
||||||
span: *error_span,
|
span: *error_span,
|
||||||
cgu_user_name,
|
cgu_user_name,
|
||||||
actual_reuse,
|
actual_reuse,
|
||||||
expected_reuse,
|
expected_reuse,
|
||||||
at_least,
|
at_least,
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sess.emit_fatal(errors::CguNotRecorded { cgu_user_name, cgu_name });
|
sess.emit_fatal(errors::CguNotRecorded { cgu_user_name, cgu_name });
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
kind="no")]
|
kind="no")]
|
||||||
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-foo",
|
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-foo",
|
||||||
cfg="cfail3",
|
cfg="cfail3",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
|
|
||||||
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-bar",
|
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-bar",
|
||||||
cfg="cfail2",
|
cfg="cfail2",
|
||||||
kind="pre-lto")]
|
kind="pre-lto")]
|
||||||
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-bar",
|
#![rustc_expected_cgu_reuse(module="cgu_invalidated_via_import-bar",
|
||||||
cfg="cfail3",
|
cfg="cfail3",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
|
|
||||||
|
|
|
@ -9,21 +9,25 @@
|
||||||
|
|
||||||
#![feature(rustc_attrs)]
|
#![feature(rustc_attrs)]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
#![rustc_expected_cgu_reuse(module = "cgu_keeps_identical_fn-foo", cfg = "cfail2", kind = "no")]
|
#![rustc_expected_cgu_reuse(
|
||||||
|
module = "cgu_keeps_identical_fn-foo",
|
||||||
|
cfg = "cfail2",
|
||||||
|
kind = "pre-lto"
|
||||||
|
)]
|
||||||
#![rustc_expected_cgu_reuse(
|
#![rustc_expected_cgu_reuse(
|
||||||
module = "cgu_keeps_identical_fn-foo",
|
module = "cgu_keeps_identical_fn-foo",
|
||||||
cfg = "cfail3",
|
cfg = "cfail3",
|
||||||
kind = "post-lto"
|
kind = "pre-lto" // Should be "post-lto", see issue #119076
|
||||||
)]
|
)]
|
||||||
#![rustc_expected_cgu_reuse(
|
#![rustc_expected_cgu_reuse(
|
||||||
module = "cgu_keeps_identical_fn-bar",
|
module = "cgu_keeps_identical_fn-bar",
|
||||||
cfg = "cfail2",
|
cfg = "cfail2",
|
||||||
kind = "post-lto"
|
kind = "pre-lto" // Should be "post-lto", see issue #119076
|
||||||
)]
|
)]
|
||||||
#![rustc_expected_cgu_reuse(
|
#![rustc_expected_cgu_reuse(
|
||||||
module = "cgu_keeps_identical_fn-bar",
|
module = "cgu_keeps_identical_fn-bar",
|
||||||
cfg = "cfail3",
|
cfg = "cfail3",
|
||||||
kind = "post-lto"
|
kind = "pre-lto" // Should be "post-lto", see issue #119076
|
||||||
)]
|
)]
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
|
|
|
@ -13,21 +13,21 @@
|
||||||
kind="no")]
|
kind="no")]
|
||||||
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-foo",
|
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-foo",
|
||||||
cfg="cfail3",
|
cfg="cfail3",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
|
|
||||||
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-bar",
|
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-bar",
|
||||||
cfg="cfail2",
|
cfg="cfail2",
|
||||||
kind="pre-lto")]
|
kind="pre-lto")]
|
||||||
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-bar",
|
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-bar",
|
||||||
cfg="cfail3",
|
cfg="cfail3",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
|
|
||||||
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-baz",
|
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-baz",
|
||||||
cfg="cfail2",
|
cfg="cfail2",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-baz",
|
#![rustc_expected_cgu_reuse(module="independent_cgus_dont_affect_each_other-baz",
|
||||||
cfg="cfail3",
|
cfg="cfail3",
|
||||||
kind="post-lto")]
|
kind="pre-lto")] // Should be "post-lto", see issue #119076
|
||||||
mod foo {
|
mod foo {
|
||||||
|
|
||||||
#[cfg(cfail1)]
|
#[cfg(cfail1)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue