diff --git a/src/test/ui/extern/issue-36122-accessing-externed-dst.rs b/src/test/ui/extern/issue-36122-accessing-externed-dst.rs new file mode 100644 index 00000000000..22229db8000 --- /dev/null +++ b/src/test/ui/extern/issue-36122-accessing-externed-dst.rs @@ -0,0 +1,6 @@ +fn main() { + extern { + static symbol: [usize]; //~ ERROR: the size for values of type + } + println!("{}", symbol[0]); +} diff --git a/src/test/ui/extern/issue-36122-accessing-externed-dst.stderr b/src/test/ui/extern/issue-36122-accessing-externed-dst.stderr new file mode 100644 index 00000000000..add3a8e7926 --- /dev/null +++ b/src/test/ui/extern/issue-36122-accessing-externed-dst.stderr @@ -0,0 +1,12 @@ +error[E0277]: the size for values of type `[usize]` cannot be known at compilation time + --> $DIR/issue-36122-accessing-externed-dst.rs:3:24 + | +LL | static symbol: [usize]; + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[usize]` + = note: to learn more, visit + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/parser/issue-58094-missing-right-square-bracket.rs b/src/test/ui/parser/issue-58094-missing-right-square-bracket.rs new file mode 100644 index 00000000000..25699f9fe11 --- /dev/null +++ b/src/test/ui/parser/issue-58094-missing-right-square-bracket.rs @@ -0,0 +1,4 @@ +// Fixed in #66054. +// ignore-tidy-trailing-newlines +// error-pattern: aborting due to 2 previous errors +#[Ѕ \ No newline at end of file diff --git a/src/test/ui/parser/issue-58094-missing-right-square-bracket.stderr b/src/test/ui/parser/issue-58094-missing-right-square-bracket.stderr new file mode 100644 index 00000000000..2c987da81d8 --- /dev/null +++ b/src/test/ui/parser/issue-58094-missing-right-square-bracket.stderr @@ -0,0 +1,16 @@ +error: this file contains an un-closed delimiter + --> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 + | +LL | #[Ѕ + | - ^ + | | + | un-closed delimiter + +error: expected item after attributes + --> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 + | +LL | #[Ѕ + | ^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/unboxed-closures/issue-30904.rs b/src/test/ui/unboxed-closures/issue-30904.rs deleted file mode 100644 index eec5e962b43..00000000000 --- a/src/test/ui/unboxed-closures/issue-30904.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![feature(fn_traits, unboxed_closures)] - -fn test FnOnce<(&'x str,)>>(_: F) {} - -struct Compose(F,G); -impl FnOnce<(T,)> for Compose -where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> { - type Output = G::Output; - extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output { - (self.1)((self.0)(x)) - } -} - -struct Str<'a>(&'a str); -fn mk_str<'a>(s: &'a str) -> Str<'a> { Str(s) } - -fn main() { - let _: for<'a> fn(&'a str) -> Str<'a> = mk_str; - // expected concrete lifetime, found bound lifetime parameter 'a - let _: for<'a> fn(&'a str) -> Str<'a> = Str; - //~^ ERROR: mismatched types - - test(|_: &str| {}); - test(mk_str); - // expected concrete lifetime, found bound lifetime parameter 'x - test(Str); //~ ERROR: type mismatch in function arguments - - test(Compose(|_: &str| {}, |_| {})); - test(Compose(mk_str, |_| {})); - // internal compiler error: cannot relate bound region: - // ReLateBound(DebruijnIndex { depth: 2 }, - // BrNamed(DefId { krate: 0, node: DefIndex(6) => test::'x }, 'x(65))) - //<= ReSkolemized(0, - // BrNamed(DefId { krate: 0, node: DefIndex(6) => test::'x }, 'x(65))) - test(Compose(Str, |_| {})); -} diff --git a/src/test/ui/unboxed-closures/issue-30904.stderr b/src/test/ui/unboxed-closures/issue-30904.stderr deleted file mode 100644 index 943cbe0ccc2..00000000000 --- a/src/test/ui/unboxed-closures/issue-30904.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-30904.rs:20:45 - | -LL | let _: for<'a> fn(&'a str) -> Str<'a> = Str; - | ^^^ expected concrete lifetime, found bound lifetime parameter 'a - | - = note: expected type `for<'a> fn(&'a str) -> Str<'a>` - found type `fn(&str) -> Str<'_> {Str::<'_>}` - -error[E0631]: type mismatch in function arguments - --> $DIR/issue-30904.rs:26:10 - | -LL | fn test FnOnce<(&'x str,)>>(_: F) {} - | ---- -------------------------- required by this bound in `test` -... -LL | struct Str<'a>(&'a str); - | ------------------------ found signature of `fn(&str) -> _` -... -LL | test(Str); - | ^^^ expected signature of `for<'x> fn(&'x str) -> _` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/unboxed-closures/issue-30906.nll.stderr b/src/test/ui/unboxed-closures/issue-30906.nll.stderr new file mode 100644 index 00000000000..5a2cbab9a15 --- /dev/null +++ b/src/test/ui/unboxed-closures/issue-30906.nll.stderr @@ -0,0 +1,8 @@ +error: higher-ranked subtype error + --> $DIR/issue-30906.rs:15:5 + | +LL | test(Compose(f, |_| {})); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/unboxed-closures/issue-30906.rs b/src/test/ui/unboxed-closures/issue-30906.rs new file mode 100644 index 00000000000..03cce832775 --- /dev/null +++ b/src/test/ui/unboxed-closures/issue-30906.rs @@ -0,0 +1,18 @@ +#![feature(fn_traits, unboxed_closures)] + +fn test FnOnce<(&'x str,)>>(_: F) {} + +struct Compose(F,G); +impl FnOnce<(T,)> for Compose +where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> { + type Output = G::Output; + extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output { + (self.1)((self.0)(x)) + } +} + +fn bad(f: fn(&'static str) -> T) { + test(Compose(f, |_| {})); //~ ERROR: mismatched types +} + +fn main() {} diff --git a/src/test/ui/unboxed-closures/issue-30906.stderr b/src/test/ui/unboxed-closures/issue-30906.stderr new file mode 100644 index 00000000000..5c3a1154e74 --- /dev/null +++ b/src/test/ui/unboxed-closures/issue-30906.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/issue-30906.rs:15:5 + | +LL | test(Compose(f, |_| {})); + | ^^^^ one type is more general than the other + | + = note: expected type `std::ops::FnOnce<(&'x str,)>` + found type `std::ops::FnOnce<(&str,)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`.