Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/doc/rustc-dev-guide/src/tests/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ prefixing each source line are replaced with `LL`). In extremely rare
situations, this mode can be disabled with the directive `//@
compile-flags: -Z ui-testing=no`.

When using `-Z ui-testing=no` the `--diagnostic-width` argument should also
be set to avoid tests failing or passing depending on the width of the terminal
from which the UI test suite is being run.

Note: The line and column numbers for `-->` lines pointing to the test are *not*
normalized, and left as-is. This ensures that the compiler continues to point to
the correct location, and keeps the stderr files readable. Ideally all
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/compiletest-self-test/ui-testing-optout.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Z ui-testing=no
//@ compile-flags: -Z ui-testing=no --diagnostic-width=80

// Line number < 10
type A = B; //~ ERROR
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/missing_span_in_backtrace.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Check what happens when the error occurs inside a std function that we can't print the span of.
//@ ignore-backends: gcc
//@ compile-flags: -Z ui-testing=no
//@ compile-flags: -Z ui-testing=no --diagnostic-width=80

use std::{
mem::{self, MaybeUninit},
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/consts/missing_span_in_backtrace.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error[E0080]: memory access failed: attempting to access 1 byte, but got ALLOC0+0x4 which is at or beyond the end of the allocation of size 4 bytes
--> $DIR/missing_span_in_backtrace.rs:16:9
|
16 | / ptr::swap_nonoverlapping(
17 | | &mut x1 as *mut _ as *mut MaybeUninit<u8>,
18 | | &mut x2 as *mut _ as *mut MaybeUninit<u8>,
19 | | 10,
20 | | );
| |_________^ evaluation of `X` failed inside this call
16 | / ... ptr::swap_nonoverlapping(
17 | | ... &mut x1 as *mut _ as *mut MaybeUninit<u8>,
18 | | ... &mut x2 as *mut _ as *mut MaybeUninit<u8>,
19 | | ... 10,
20 | | ... );
| |_______^ evaluation of `X` failed inside this call
|
note: inside `swap_nonoverlapping::compiletime::<MaybeUninit<u8>>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/error-emitter/trimmed_multiline_suggestion.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Z ui-testing=no
//@ compile-flags: -Z ui-testing=no --diagnostic-width=80
fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/error-emitter/trimmed_multiline_suggestion.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error[E0061]: this function takes 6 arguments but 5 arguments were supplied
note: function defined here
--> $DIR/trimmed_multiline_suggestion.rs:2:4
|
2 | fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}
2 | fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i3...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -------
help: provide the argument
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/modules/issue-107649.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Z ui-testing=no
//@ compile-flags: -Z ui-testing=no --diagnostic-width=80
#[path = "auxiliary/dummy_lib.rs"]
mod lib;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/span/issue-71363.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Z ui-testing=no
//@ compile-flags: -Z ui-testing=no --diagnostic-width=80

struct MyError;
impl std::error::Error for MyError {}
Expand Down
Loading