Skip to content

Commit fe33856

Browse files
committed
Add "reference" as a known compiletest header
This adds the "reference" compiletest header so that the Rust reference can add annotations to the test suite in order to link tests to individual rules in the reference. Tooling in the reference repo will be responsible for collecting these annotations and linking to the tests. More details are in MCP 783: rust-lang/compiler-team#783
1 parent baaf3e6 commit fe33856

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

src/tools/compiletest/src/command-list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
208208
"pretty-compare-only",
209209
"pretty-expanded",
210210
"pretty-mode",
211+
"reference",
211212
"regex-error-pattern",
212213
"remap-src-base",
213214
"revisions",

tests/run-make/include-all-symbols-linking/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Linkers treat archives differently from object files: all object files participate in linking,
2-
// while archives will only participate in linking if they can satisfy at least one undefined
3-
// reference (version scripts doesn't count). This causes `#[no_mangle]` or `#[used]` items to
2+
// while archives will only participate in linking if they can satisfy at least one undefined reference
3+
// (version scripts doesn't count). This causes `#[no_mangle]` or `#[used]` items to
44
// be ignored by the linker, and since they never participate in the linking, using `KEEP` in the
55
// linker scripts can't keep them either. This causes #47384. After the fix in #95604, this test
66
// checks that these symbols and sections successfully appear in the output dynamic library.

tests/ui/destructure-trait-ref.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// The regression test for #15031 to make sure destructuring trait
2-
// reference work properly.
1+
// The regression test for #15031 to make sure destructuring trait reference work properly.
32

43
#![feature(box_patterns)]
54

tests/ui/destructure-trait-ref.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0033]: type `&dyn T` cannot be dereferenced
2-
--> $DIR/destructure-trait-ref.rs:26:9
2+
--> $DIR/destructure-trait-ref.rs:25:9
33
|
44
LL | let &x = &1isize as &dyn T;
55
| ^^ type `&dyn T` cannot be dereferenced
66

77
error[E0033]: type `&dyn T` cannot be dereferenced
8-
--> $DIR/destructure-trait-ref.rs:27:10
8+
--> $DIR/destructure-trait-ref.rs:26:10
99
|
1010
LL | let &&x = &(&1isize as &dyn T);
1111
| ^^ type `&dyn T` cannot be dereferenced
1212

1313
error[E0033]: type `Box<dyn T>` cannot be dereferenced
14-
--> $DIR/destructure-trait-ref.rs:28:9
14+
--> $DIR/destructure-trait-ref.rs:27:9
1515
|
1616
LL | let box x = Box::new(1isize) as Box<dyn T>;
1717
| ^^^^^ type `Box<dyn T>` cannot be dereferenced
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/destructure-trait-ref.rs:32:10
20+
--> $DIR/destructure-trait-ref.rs:31:10
2121
|
2222
LL | let &&x = &1isize as &dyn T;
2323
| ^^ ----------------- this expression has type `&dyn T`
@@ -33,7 +33,7 @@ LL + let &x = &1isize as &dyn T;
3333
|
3434

3535
error[E0308]: mismatched types
36-
--> $DIR/destructure-trait-ref.rs:36:11
36+
--> $DIR/destructure-trait-ref.rs:35:11
3737
|
3838
LL | let &&&x = &(&1isize as &dyn T);
3939
| ^^ -------------------- this expression has type `&&dyn T`
@@ -49,7 +49,7 @@ LL + let &&x = &(&1isize as &dyn T);
4949
|
5050

5151
error[E0308]: mismatched types
52-
--> $DIR/destructure-trait-ref.rs:40:13
52+
--> $DIR/destructure-trait-ref.rs:39:13
5353
|
5454
LL | let box box x = Box::new(1isize) as Box<dyn T>;
5555
| ^^^^^ ------------------------------ this expression has type `Box<dyn T>`

tests/ui/unboxed-closures/unboxed-closure-region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Test that an unboxed closure that captures a free variable by
2-
// reference cannot escape the region of that variable.
1+
// Test that an unboxed closure that captures a free variable by reference
2+
// cannot escape the region of that variable.
33

44

55
fn main() {

tests/ui/variance/variance-use-covariant-struct-1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// Test that a covariant struct does not permit the lifetime of a
2-
// reference to be enlarged.
1+
// Test that a covariant struct does not permit the lifetime of a reference to be enlarged.
32

43
struct SomeStruct<T>(T);
54

tests/ui/variance/variance-use-covariant-struct-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/variance-use-covariant-struct-1.rs:10:5
2+
--> $DIR/variance-use-covariant-struct-1.rs:9:5
33
|
44
LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
55
| ---- ---- lifetime `'max` defined here

0 commit comments

Comments
 (0)