Skip to content

Commit 70c1afd

Browse files
authored
Rollup merge of #155961 - jdonszelmann:deny-warnings-stable, r=mejrs
Deny warnings in the test for crates that are available on stable We've got a couple of crates, like `rustc_type_ir` that have parts disabled on stable. I believe part of this is so, for example, rust-analyzer can use bits of the compiler. We previously allowed warnings here, and I ran into one. This denies warnings in the test that compiles these stable crates (I chose not to on the crate itself, so you don't *constantly* run into the warnings if you have turned that off in `config.toml`). This test doesn't run by default, but it does run in CI.
2 parents 746ea54 + b8e547a commit 70c1afd

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

compiler/rustc_type_ir/src/binder.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,17 @@ pub struct EarlyBinder<I: Interner, T> {
375375

376376
impl<I: Interner, T: Eq> Eq for EarlyBinder<I, T> {}
377377

378-
/// For early binders, you should first call `instantiate` before using any visitors.
378+
// FIXME(154045): Recommended as per https://github.com/rust-lang/rust/issues/154045, this is so sad :((
379379
#[cfg(feature = "nightly")]
380-
impl<I: Interner, T> !TypeFoldable<I> for ty::EarlyBinder<I, T> {}
380+
macro_rules! generate { ($( $tt:tt )*) => { $( $tt )* } }
381381

382-
/// For early binders, you should first call `instantiate` before using any visitors.
383382
#[cfg(feature = "nightly")]
384-
impl<I: Interner, T> !TypeVisitable<I> for ty::EarlyBinder<I, T> {}
383+
generate!(
384+
/// For early binders, you should first call `instantiate` before using any visitors.
385+
impl<I: Interner, T> !TypeFoldable<I> for ty::EarlyBinder<I, T> {}
386+
/// For early binders, you should first call `instantiate` before using any visitors.
387+
impl<I: Interner, T> !TypeVisitable<I> for ty::EarlyBinder<I, T> {}
388+
);
385389

386390
impl<I: Interner, T> EarlyBinder<I, T> {
387391
pub fn bind(value: T) -> EarlyBinder<I, T> {

compiler/rustc_type_ir/src/ir_print.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use std::fmt;
22

33
use crate::{
4-
AliasTerm, AliasTy, Binder, ClosureKind, CoercePredicate, ExistentialProjection,
5-
ExistentialTraitRef, FnSig, HostEffectPredicate, Interner, NormalizesTo, OutlivesPredicate,
6-
PatternKind, Placeholder, ProjectionPredicate, SubtypePredicate, TraitPredicate, TraitRef,
7-
UnevaluatedConst,
4+
AliasTerm, AliasTy, Binder, CoercePredicate, ExistentialProjection, ExistentialTraitRef, FnSig,
5+
HostEffectPredicate, Interner, NormalizesTo, OutlivesPredicate, PatternKind, Placeholder,
6+
ProjectionPredicate, SubtypePredicate, TraitPredicate, TraitRef,
87
};
8+
#[cfg(feature = "nightly")]
9+
use crate::{ClosureKind, UnevaluatedConst};
910

1011
pub trait IrPrint<T> {
1112
fn print(t: &T, fmt: &mut fmt::Formatter<'_>) -> fmt::Result;

tests/run-make-cargo/rustc-crates-on-stable/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
.env("RUSTC_STAGE", "0")
1111
.env("RUSTC", rustc_path())
1212
// We want to disallow all nightly features to simulate a stable build
13-
.env("RUSTFLAGS", "-Zallow-features=")
13+
.env("RUSTFLAGS", "-D warnings -Zallow-features=")
1414
.arg("build")
1515
.arg("--manifest-path")
1616
.arg(source_root().join("Cargo.toml"))

0 commit comments

Comments
 (0)