blob: 241de11ed59ca70bdababfa66528b16f13a6045b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Test output of const super trait errors in both stable and nightly.
// We don't want to provide suggestions on stable that only make sense in nightly.
use run_make_support::{diff, rustc};
fn main() {
let out = rustc()
.input("const-super-trait.rs")
.env("RUSTC_BOOTSTRAP", "-1")
.cfg("feature_enabled")
.run_fail()
.assert_stderr_not_contains(
"as `#[const_trait]` to allow it to have `const` implementations",
)
.stderr_utf8();
diff()
.expected_file("const-super-trait-stable-enabled.stderr")
.normalize(
"may not be used on the .* release channel",
"may not be used on the NIGHTLY release channel",
)
.actual_text("(rustc)", &out)
.run();
let out = rustc()
.input("const-super-trait.rs")
.cfg("feature_enabled")
.ui_testing()
.run_fail()
.assert_stderr_not_contains("enable `#![feature(const_trait_impl)]` in your crate and mark")
.assert_stderr_contains("as `#[const_trait]` to allow it to have `const` implementations")
.stderr_utf8();
diff()
.expected_file("const-super-trait-nightly-enabled.stderr")
.actual_text("(rustc)", &out)
.run();
let out = rustc()
.input("const-super-trait.rs")
.env("RUSTC_BOOTSTRAP", "-1")
.run_fail()
.assert_stderr_not_contains("enable `#![feature(const_trait_impl)]` in your crate and mark")
.assert_stderr_not_contains(
"as `#[const_trait]` to allow it to have `const` implementations",
)
.stderr_utf8();
diff()
.expected_file("const-super-trait-stable-disabled.stderr")
.actual_text("(rustc)", &out)
.run();
let out = rustc()
.input("const-super-trait.rs")
.ui_testing()
.run_fail()
.assert_stderr_contains("enable `#![feature(const_trait_impl)]` in your crate and mark")
.stderr_utf8();
diff()
.expected_file("const-super-trait-nightly-disabled.stderr")
.actual_text("(rustc)", &out)
.run();
}
|