From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/cross/cross-borrow-trait.rs | 13 --------- src/test/ui/cross/cross-borrow-trait.stderr | 14 ---------- .../auxiliary/extern_macro_crate.rs | 13 --------- .../ui/cross/cross-crate-macro-backtrace/main.rs | 8 ------ .../cross/cross-crate-macro-backtrace/main.stderr | 10 ------- src/test/ui/cross/cross-file-errors/main.rs | 7 ----- src/test/ui/cross/cross-file-errors/main.stderr | 15 ----------- src/test/ui/cross/cross-file-errors/underscore.rs | 10 ------- src/test/ui/cross/cross-fn-cache-hole.rs | 31 ---------------------- src/test/ui/cross/cross-fn-cache-hole.stderr | 12 --------- 10 files changed, 133 deletions(-) delete mode 100644 src/test/ui/cross/cross-borrow-trait.rs delete mode 100644 src/test/ui/cross/cross-borrow-trait.stderr delete mode 100644 src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs delete mode 100644 src/test/ui/cross/cross-crate-macro-backtrace/main.rs delete mode 100644 src/test/ui/cross/cross-crate-macro-backtrace/main.stderr delete mode 100644 src/test/ui/cross/cross-file-errors/main.rs delete mode 100644 src/test/ui/cross/cross-file-errors/main.stderr delete mode 100644 src/test/ui/cross/cross-file-errors/underscore.rs delete mode 100644 src/test/ui/cross/cross-fn-cache-hole.rs delete mode 100644 src/test/ui/cross/cross-fn-cache-hole.stderr (limited to 'src/test/ui/cross') diff --git a/src/test/ui/cross/cross-borrow-trait.rs b/src/test/ui/cross/cross-borrow-trait.rs deleted file mode 100644 index 180a75e3d..000000000 --- a/src/test/ui/cross/cross-borrow-trait.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Test that cross-borrowing (implicitly converting from `Box` 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 = Box::new(Foo); - let _y: &dyn Trait = x; //~ ERROR E0308 - //~| expected reference `&dyn Trait` - //~| found struct `Box` -} diff --git a/src/test/ui/cross/cross-borrow-trait.stderr b/src/test/ui/cross/cross-borrow-trait.stderr deleted file mode 100644 index 81f309eae..000000000 --- a/src/test/ui/cross/cross-borrow-trait.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/cross-borrow-trait.rs:10:26 - | -LL | let _y: &dyn Trait = x; - | ---------- ^ expected `&dyn Trait`, found struct `Box` - | | - | expected due to this - | - = note: expected reference `&dyn Trait` - found struct `Box` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs b/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs deleted file mode 100644 index fbda3dbe9..000000000 --- a/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_type = "dylib"] - -pub fn print(_args: std::fmt::Arguments) {} - -#[macro_export] -macro_rules! myprint { - ($($arg:tt)*) => ($crate::print(format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! myprintln { - ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); -} diff --git a/src/test/ui/cross/cross-crate-macro-backtrace/main.rs b/src/test/ui/cross/cross-crate-macro-backtrace/main.rs deleted file mode 100644 index f7d4330ab..000000000 --- a/src/test/ui/cross/cross-crate-macro-backtrace/main.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:extern_macro_crate.rs -#[macro_use(myprintln, myprint)] -extern crate extern_macro_crate; - -fn main() { - myprintln!("{}"); - //~^ ERROR in format string -} diff --git a/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr b/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr deleted file mode 100644 index 5bd4ea97e..000000000 --- a/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: 1 positional argument in format string, but no arguments were given - --> $DIR/main.rs:6:5 - | -LL | myprintln!("{}"); - | ^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `concat` which comes from the expansion of the macro `myprintln` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/cross/cross-file-errors/main.rs b/src/test/ui/cross/cross-file-errors/main.rs deleted file mode 100644 index 4219f892d..000000000 --- a/src/test/ui/cross/cross-file-errors/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -#[macro_use] -mod underscore; - -fn main() { - underscore!(); - //~^ ERROR `_` can only be used on the left-hand side of an assignment -} diff --git a/src/test/ui/cross/cross-file-errors/main.stderr b/src/test/ui/cross/cross-file-errors/main.stderr deleted file mode 100644 index 293a300ed..000000000 --- a/src/test/ui/cross/cross-file-errors/main.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/underscore.rs:8:9 - | -LL | _ - | ^ `_` not allowed here - | - ::: $DIR/main.rs:5:5 - | -LL | underscore!(); - | ------------- in this macro invocation - | - = note: this error originates in the macro `underscore` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/cross/cross-file-errors/underscore.rs b/src/test/ui/cross/cross-file-errors/underscore.rs deleted file mode 100644 index 76e72a93f..000000000 --- a/src/test/ui/cross/cross-file-errors/underscore.rs +++ /dev/null @@ -1,10 +0,0 @@ -// We want this file only so we can test cross-file error -// messages, but we don't want it in an external crate. -// ignore-test -#![crate_type = "lib"] - -macro_rules! underscore { - () => ( - _ - ) -} diff --git a/src/test/ui/cross/cross-fn-cache-hole.rs b/src/test/ui/cross/cross-fn-cache-hole.rs deleted file mode 100644 index c38a5001a..000000000 --- a/src/test/ui/cross/cross-fn-cache-hole.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Check that when there are vacuous predicates in the environment -// (which make a fn uncallable) we don't erroneously cache those and -// then consider them satisfied elsewhere. The current technique for -// doing this is to not use global caches when there is a chance that -// the environment contains such a predicate. -// We still error for `i32: Bar` pending #48214 - -trait Foo: Bar { -} - -trait Bar { } - -// We don't always check where clauses for sanity, but in this case -// wfcheck does report an error here: -fn vacuous() - where i32: Foo //~ ERROR the trait bound `i32: Bar` is not satisfied -{ - // ... the original intention was to check that we don't use that - // vacuous where clause (which could never be satisfied) to accept - // the following line and then mess up calls elsewhere. - require::(); -} - -fn require() - where A: Bar -{ -} - -fn main() { - require::(); -} diff --git a/src/test/ui/cross/cross-fn-cache-hole.stderr b/src/test/ui/cross/cross-fn-cache-hole.stderr deleted file mode 100644 index 7e15562b0..000000000 --- a/src/test/ui/cross/cross-fn-cache-hole.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0277]: the trait bound `i32: Bar` is not satisfied - --> $DIR/cross-fn-cache-hole.rs:16:11 - | -LL | where i32: Foo - | ^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `i32` - | - = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3