Skip to content

Commit 7b2d50b

Browse files
committed
regression in beta build
1 parent 4227bc1 commit 7b2d50b

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

local-crates/error-code/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ authors = ["Giacomo Pasini <g.pasini98@gmail.com>"]
55
edition = "2018"
66

77
[dependencies]
8+
9+
10+
[build-dependencies]
11+
rustc_version = "0.2.3"

local-crates/error-code/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use rustc_version::{version_meta, Channel};
2+
3+
fn main() {
4+
if let Channel::Beta = version_meta().unwrap().channel {
5+
println!("cargo:rustc-cfg=channel_beta");
6+
}
7+
8+
// Rebuild the crate only if the build.rs file changes
9+
println!("cargo:rebuild-if-changed=build.rs");
10+
}

local-crates/error-code/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#[cfg(channel_beta)]
12
pub const STRING: String = String::from("invalid");
23

4+
#[cfg(channel_beta)]
35
static X: i32 = 42;
6+
#[cfg(channel_beta)]
47
const Y: i32 = X;
58

69
fn hello() {

tests/minicrater/full/results.expected.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@
113113
"Local": "error-code"
114114
},
115115
"name": "error-code (local)",
116-
"res": "build-fail",
116+
"res": "regressed",
117117
"runs": [
118118
{
119119
"log": "stable/local/error-code",
120-
"res": "build-fail:compiler-error(E0013, E0015)"
120+
"res": "test-pass"
121121
},
122122
{
123123
"log": "beta/local/error-code",

0 commit comments

Comments
 (0)