diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rustdoc-gui/search-error.goml | 6 | ||||
| -rw-r--r-- | tests/ui/const_prop/ice-issue-111353.rs | 7 | ||||
| -rw-r--r-- | tests/ui/const_prop/ice-issue-96944.rs | 26 | ||||
| -rw-r--r-- | tests/ui/generic-associated-types/issue-90014-tait2.rs | 22 | ||||
| -rw-r--r-- | tests/ui/generic-associated-types/issue-90014-tait2.stderr | 13 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/under-binder.rs | 9 | ||||
| -rw-r--r-- | tests/ui/type-alias-impl-trait/under-binder.stderr | 12 |
7 files changed, 62 insertions, 33 deletions
diff --git a/tests/rustdoc-gui/search-error.goml b/tests/rustdoc-gui/search-error.goml index d21905e90ae..70aeda1769a 100644 --- a/tests/rustdoc-gui/search-error.goml +++ b/tests/rustdoc-gui/search-error.goml @@ -20,20 +20,20 @@ call-function: ( "check-colors", { "theme": "ayu", - "error_background": "rgb(79, 76, 76)", + "error_background": "#4f4c4c", }, ) call-function: ( "check-colors", { "theme": "dark", - "error_background": "rgb(72, 72, 72)", + "error_background": "#484848", }, ) call-function: ( "check-colors", { "theme": "light", - "error_background": "rgb(208, 204, 204)", + "error_background": "#d0cccc", }, ) diff --git a/tests/ui/const_prop/ice-issue-111353.rs b/tests/ui/const_prop/ice-issue-111353.rs new file mode 100644 index 00000000000..99d1b792fea --- /dev/null +++ b/tests/ui/const_prop/ice-issue-111353.rs @@ -0,0 +1,7 @@ +// build-pass +#![crate_type = "lib"] +#![feature(unsized_fn_params)] + +pub fn f(mut x: [i32]) { + x[0] = 1; +} diff --git a/tests/ui/const_prop/ice-issue-96944.rs b/tests/ui/const_prop/ice-issue-96944.rs new file mode 100644 index 00000000000..74baffddd8b --- /dev/null +++ b/tests/ui/const_prop/ice-issue-96944.rs @@ -0,0 +1,26 @@ +// build-pass +#![crate_type = "lib"] +#![allow(arithmetic_overflow)] + +pub trait BitSplit { + type Half; + fn merge(halves: [Self::Half; 2]) -> Self; +} + +macro_rules! impl_ints { + ($int:ty => $half:ty; $mask:expr) => { + impl BitSplit for $int { + type Half = $half; + #[inline] + fn merge(halves: [Self::Half; 2]) -> Self { + const HALF_SIZE: usize = std::mem::size_of::<$half>() * 8; + (halves[0] << HALF_SIZE) as $int | halves[1] as $int + } + } + }; +} + +impl_ints!(u128 => u64; 0x0000_0000_0000_0000_FFFF_FFFF_FFFF_FFFF); +impl_ints!( u64 => u32; 0x0000_0000_FFFF_FFFF); +impl_ints!( u32 => u16; 0x0000_FFFF); +impl_ints!( u16 => u8; 0x00FF); diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs index 34330ed8cba..7fb14eddc2c 100644 --- a/tests/ui/generic-associated-types/issue-90014-tait2.rs +++ b/tests/ui/generic-associated-types/issue-90014-tait2.rs @@ -1,27 +1,9 @@ //! This test checks that opaque type collection doesn't try to normalize the projection //! without respecting its binders (which would ICE). //! Unfortunately we don't even reach opaque type collection, as we ICE in typeck before that. -// known-bug: #109281 -// failure-status: 101 -// error-pattern:internal compiler error -// normalize-stderr-test "internal compiler error.*" -> "" -// normalize-stderr-test "DefId\([^)]*\)" -> "..." -// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> "" -// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" -// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" -// normalize-stderr-test "note: compiler flags.*\n\n" -> "" -// normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" -// normalize-stderr-test "thread.*panicked.*:\n.*\n" -> "" -// normalize-stderr-test "stack backtrace:\n" -> "" -// normalize-stderr-test "\s\d{1,}: .*\n" -> "" -// normalize-stderr-test "\s at .*\n" -> "" -// normalize-stderr-test ".*note: Some details.*\n" -> "" -// normalize-stderr-test "\n\n[ ]*\n" -> "" -// normalize-stderr-test "compiler/.*: projection" -> "projection" -// normalize-stderr-test ".*omitted \d{1,} frame.*\n" -> "" -// normalize-stderr-test "error: [\s\n]*query stack" -> "error: query stack" -// normalize-stderr-test "[\n\s]*\nquery stack during panic:" -> "query stack during panic:" +//! See #109281 for the original report. // edition:2018 +// error-pattern: expected generic lifetime parameter, found `'a` #![feature(type_alias_impl_trait)] #![allow(incomplete_features)] diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.stderr b/tests/ui/generic-associated-types/issue-90014-tait2.stderr index 2538eb46dfa..d04788a919a 100644 --- a/tests/ui/generic-associated-types/issue-90014-tait2.stderr +++ b/tests/ui/generic-associated-types/issue-90014-tait2.stderr @@ -1,12 +1,5 @@ -error: - --> $DIR/issue-90014-tait2.rs:44:27 - | -LL | fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^query stack during panic: -#0 [typeck] type-checking `<impl at $DIR/issue-90014-tait2.rs:43:1: 43:13>::make_fut` -#1 [type_of] computing type of `Fut::{opaque#0}` -#2 [check_mod_item_types] checking item types in top-level module -#3 [analysis] running analysis passes on this crate -end of query stack +error[E0792]: expected generic lifetime parameter, found `'a` + error: aborting due to previous error +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/under-binder.rs b/tests/ui/type-alias-impl-trait/under-binder.rs new file mode 100644 index 00000000000..caf21d64027 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/under-binder.rs @@ -0,0 +1,9 @@ +#![feature(type_alias_impl_trait)] + +type Opaque<'a> = impl Sized + 'a; + +fn test(f: fn(u8)) -> fn(Opaque<'_>) { + f //~ ERROR E0792 +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/under-binder.stderr b/tests/ui/type-alias-impl-trait/under-binder.stderr new file mode 100644 index 00000000000..82c4ec97335 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/under-binder.stderr @@ -0,0 +1,12 @@ +error[E0792]: expected generic lifetime parameter, found `'_` + --> $DIR/under-binder.rs:6:5 + | +LL | type Opaque<'a> = impl Sized + 'a; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | f + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0792`. |
