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: 0 additions & 4 deletions tests/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ Tests for `#![feature(coverage_attribute)]`. See [Tracking issue for function at

Tests for crate resolution and loading behavior, including `extern crate` declarations, `--extern` flags, or the `use` keyword.

## `tests/ui/cross/`: Various tests related to the concept of "cross"

**FIXME**: The unifying topic of these tests appears to be that their filenames begin with the word "cross". The similarities end there - one test is about "cross-borrowing" a `Box<T>` into `&T`, while another is about a global trait used "across" files. Some of this terminology is really outdated and does not match the current terminology. Additionally, "cross" is also way too generic, it's easy to confuse with cross-compile.

## `tests/ui/cross-crate/`: Cross-Crate Interaction

Tests for behavior spanning multiple crates, including visibility rules, trait implementations, and type resolution across crate boundaries.
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/coercion/no-implicit-box-to-ref-coercion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Test that implicitly converting from `Box<T>` to `&T` is
// forbidden when `T` is a trait.

struct Foo;
trait Trait { fn foo(&self) {} }
impl Trait for Foo {}

pub fn main() {
let x: Box<dyn Trait> = Box::new(Foo);
let _y: &dyn Trait = x; //~ ERROR E0308
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/cross-borrow-trait.rs:12:26
--> $DIR/no-implicit-box-to-ref-coercion.rs:10:26
|
LL | let _y: &dyn Trait = x;
| ---------- ^ expected `&dyn Trait`, found `Box<dyn Trait>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: 1 positional argument in format string, but no arguments were given
--> $DIR/main.rs:6:5
--> $DIR/cross-crate-macro-backtrace.rs:6:5
|
LL | myprintln!("{}");
| ^^^^^^^^^^^^^^^^
Expand Down
15 changes: 0 additions & 15 deletions tests/ui/cross/cross-borrow-trait.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: in expressions, `_` can only be used on the left-hand side of an assignme
LL | _
| ^ `_` not allowed here
|
::: $DIR/main.rs:5:5
::: $DIR/cross-file-errors.rs:5:5
|
LL | underscore!();
| ------------- in this macro invocation
Expand Down
Loading