Merge from rustc
This commit is contained in:
commit
036929d86d
433 changed files with 3551 additions and 2190 deletions
47
tests/codegen/sanitizer-kasan-emits-instrumentation.rs
Normal file
47
tests/codegen/sanitizer-kasan-emits-instrumentation.rs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// Verifies that `-Zsanitizer=kernel-address` emits sanitizer instrumentation.
|
||||
|
||||
// compile-flags: -Zsanitizer=kernel-address
|
||||
// revisions: aarch64 riscv64imac riscv64gc x86_64
|
||||
//[aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//[aarch64] needs-llvm-components: aarch64
|
||||
//[riscv64imac] compile-flags: --target riscv64imac-unknown-none-elf
|
||||
//[riscv64imac] needs-llvm-components: riscv
|
||||
//[riscv64imac] min-llvm-version: 16
|
||||
//[riscv64gc] compile-flags: --target riscv64gc-unknown-none-elf
|
||||
//[riscv64gc] needs-llvm-components: riscv
|
||||
//[riscv64gc] min-llvm-version: 16
|
||||
//[x86_64] compile-flags: --target x86_64-unknown-none
|
||||
//[x86_64] needs-llvm-components: x86
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
#![feature(no_core, no_sanitize, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
#[lang = "copy"]
|
||||
trait Copy {}
|
||||
|
||||
impl Copy for u8 {}
|
||||
|
||||
// CHECK-LABEL: ; sanitizer_kasan_emits_instrumentation::unsanitized
|
||||
// CHECK-NEXT: ; Function Attrs:
|
||||
// CHECK-NOT: sanitize_address
|
||||
// CHECK: start:
|
||||
// CHECK-NOT: call void @__asan_report_load
|
||||
// CHECK: }
|
||||
#[no_sanitize(address)]
|
||||
pub fn unsanitized(b: &mut u8) -> u8 {
|
||||
*b
|
||||
}
|
||||
|
||||
// CHECK-LABEL: ; sanitizer_kasan_emits_instrumentation::sanitized
|
||||
// CHECK-NEXT: ; Function Attrs:
|
||||
// CHECK: sanitize_address
|
||||
// CHECK: start:
|
||||
// CHECK: call void @__asan_report_load
|
||||
// CHECK: }
|
||||
pub fn sanitized(b: &mut u8) -> u8 {
|
||||
*b
|
||||
}
|
||||
|
|
@ -86,8 +86,6 @@
|
|||
|
||||
bb6: {
|
||||
_10 = ((_7 as Some).0: usize); // scope 3 at $DIR/funky_arms.rs:+13:17: +13:26
|
||||
StorageLive(_11); // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
|
||||
_11 = &mut (*_1); // scope 3 at $DIR/funky_arms.rs:+15:43: +15:46
|
||||
StorageLive(_13); // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
|
||||
_13 = _6; // scope 3 at $DIR/funky_arms.rs:+15:53: +15:57
|
||||
StorageLive(_14); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
|
||||
|
|
@ -95,7 +93,7 @@
|
|||
_15 = _10 as u32 (IntToInt); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
|
||||
_14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
|
||||
StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:+15:78: +15:79
|
||||
_0 = float_to_exponential_common_exact::<T>(move _11, _2, move _13, move _14, _3) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
|
||||
_0 = float_to_exponential_common_exact::<T>(_1, _2, move _13, move _14, _3) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
|
||||
// mir::Constant
|
||||
// + span: $DIR/funky_arms.rs:26:9: 26:42
|
||||
// + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
|
||||
|
|
@ -104,16 +102,13 @@
|
|||
bb7: {
|
||||
StorageDead(_14); // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
|
||||
StorageDead(_13); // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
|
||||
StorageDead(_11); // scope 3 at $DIR/funky_arms.rs:+15:86: +15:87
|
||||
goto -> bb10; // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
|
||||
}
|
||||
|
||||
bb8: {
|
||||
StorageLive(_18); // scope 2 at $DIR/funky_arms.rs:+17:46: +17:49
|
||||
_18 = &mut (*_1); // scope 2 at $DIR/funky_arms.rs:+17:46: +17:49
|
||||
StorageLive(_20); // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
|
||||
_20 = _6; // scope 2 at $DIR/funky_arms.rs:+17:56: +17:60
|
||||
_0 = float_to_exponential_common_shortest::<T>(move _18, _2, move _20, _3) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
|
||||
_0 = float_to_exponential_common_shortest::<T>(_1, _2, move _20, _3) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
|
||||
// mir::Constant
|
||||
// + span: $DIR/funky_arms.rs:28:9: 28:45
|
||||
// + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
|
||||
|
|
@ -121,7 +116,6 @@
|
|||
|
||||
bb9: {
|
||||
StorageDead(_20); // scope 2 at $DIR/funky_arms.rs:+17:67: +17:68
|
||||
StorageDead(_18); // scope 2 at $DIR/funky_arms.rs:+17:67: +17:68
|
||||
goto -> bb10; // scope 2 at $DIR/funky_arms.rs:+13:5: +18:6
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ fn a(_1: &mut [T]) -> &mut [T] {
|
|||
let mut _4: &mut [T]; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
scope 1 (inlined <[T] as AsMut<[T]>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:3:7: 3:15
|
||||
debug self => _4; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
let mut _5: &mut [T]; // in scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
}
|
||||
|
||||
bb0: {
|
||||
|
|
@ -16,10 +15,7 @@ fn a(_1: &mut [T]) -> &mut [T] {
|
|||
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
_4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageLive(_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
_5 = &mut (*_4); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
_3 = &mut (*_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
StorageDead(_5); // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
_3 = _4; // scope 1 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
||||
_2 = &mut (*_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageDead(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
|
||||
_0 = &mut (*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
|
|
|
|||
|
|
@ -8,10 +8,8 @@ fn b(_1: &mut Box<T>) -> &mut T {
|
|||
let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
scope 1 (inlined <Box<T> as AsMut<T>>::as_mut) { // at $DIR/issue_58867_inline_as_ref_as_mut.rs:8:7: 8:15
|
||||
debug self => _4; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _5: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _6: &mut T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _7: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _8: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _5: std::boxed::Box<T>; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
let mut _6: *const T; // in scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
}
|
||||
|
||||
bb0: {
|
||||
|
|
@ -19,15 +17,9 @@ fn b(_1: &mut Box<T>) -> &mut T {
|
|||
StorageLive(_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageLive(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
_4 = &mut (*_1); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
StorageLive(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_7 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_8 = (((_7.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_6 = &mut (*_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_5 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_6 = (((_5.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_3 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
_2 = &mut (*_3); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
StorageDead(_4); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:14: +1:15
|
||||
_0 = &mut (*_2); // scope 0 at $DIR/issue_58867_inline_as_ref_as_mut.rs:+1:5: +1:15
|
||||
|
|
|
|||
33
tests/rustdoc/reexport-attr-merge.rs
Normal file
33
tests/rustdoc/reexport-attr-merge.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// Regression test for <https://github.com/rust-lang/rust/issues/59368>.
|
||||
// The goal is to ensure that `doc(hidden)`, `doc(inline)` and `doc(no_inline)`
|
||||
// are not copied from an item when inlined.
|
||||
|
||||
#![crate_name = "foo"]
|
||||
#![feature(doc_cfg)]
|
||||
|
||||
// @has 'foo/index.html'
|
||||
|
||||
#[doc(hidden, cfg(feature = "foo"))]
|
||||
pub struct Foo;
|
||||
|
||||
#[doc(hidden, no_inline, cfg(feature = "bar"))]
|
||||
pub use Foo as Foo1;
|
||||
|
||||
#[doc(hidden, inline)]
|
||||
pub use Foo1 as Foo2;
|
||||
|
||||
// First we ensure that only the reexport `Bar2` and the inlined struct `Bar`
|
||||
// are inlined.
|
||||
// @count - '//a[@class="struct"]' 2
|
||||
// Then we check that both `cfg` are displayed.
|
||||
// @has - '//*[@class="stab portability"]' 'foo'
|
||||
// @has - '//*[@class="stab portability"]' 'bar'
|
||||
// And finally we check that the only element displayed is `Bar`.
|
||||
// @has - '//a[@class="struct"]' 'Bar'
|
||||
#[doc(inline)]
|
||||
pub use Foo2 as Bar;
|
||||
|
||||
// This one should appear but `Bar2` won't be linked because there is no
|
||||
// `#[doc(inline)]`.
|
||||
// @has - '//*[@id="reexport.Bar2"]' 'pub use Foo2 as Bar2;'
|
||||
pub use Foo2 as Bar2;
|
||||
|
|
@ -7,7 +7,10 @@ LL | fn oom() -> ! {
|
|||
| _-^^^^^^^^^^^^
|
||||
LL | | loop {}
|
||||
LL | | }
|
||||
| |_- argument of type `core::alloc::Layout` unexpected
|
||||
| | -
|
||||
| | |
|
||||
| |_unexpected argument of type `core::alloc::Layout`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/alloc-error-handler-bad-signature-3.rs:10:4
|
||||
|
|
@ -15,10 +18,6 @@ note: function defined here
|
|||
LL | fn oom() -> ! {
|
||||
| ^^^
|
||||
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | fn oom() -> !() {
|
||||
| ++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -16,17 +16,16 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/basic.rs:21:5
|
||||
|
|
||||
LL | extra("");
|
||||
| ^^^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^^^ --
|
||||
| |
|
||||
| unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/basic.rs:14:4
|
||||
|
|
||||
LL | fn extra() {}
|
||||
| ^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | extra();
|
||||
| ~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/basic.rs:22:5
|
||||
|
|
|
|||
|
|
@ -2,65 +2,61 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/exotic-calls.rs:2:5
|
||||
|
|
||||
LL | t(1i32);
|
||||
| ^ ---- argument of type `i32` unexpected
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: callable defined here
|
||||
--> $DIR/exotic-calls.rs:1:11
|
||||
|
|
||||
LL | fn foo<T: Fn()>(t: T) {
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | t();
|
||||
| ~~
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:7:5
|
||||
|
|
||||
LL | t(1i32);
|
||||
| ^ ---- argument of type `i32` unexpected
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: type parameter defined here
|
||||
--> $DIR/exotic-calls.rs:6:11
|
||||
|
|
||||
LL | fn bar(t: impl Fn()) {
|
||||
| ^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | t();
|
||||
| ~~
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:16:5
|
||||
|
|
||||
LL | baz()(1i32)
|
||||
| ^^^^^ ---- argument of type `i32` unexpected
|
||||
| ^^^^^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: opaque type defined here
|
||||
--> $DIR/exotic-calls.rs:11:13
|
||||
|
|
||||
LL | fn baz() -> impl Fn() {
|
||||
| ^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | baz()()
|
||||
| ~~
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:22:5
|
||||
|
|
||||
LL | x(1i32);
|
||||
| ^ ---- argument of type `i32` unexpected
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/exotic-calls.rs:21:13
|
||||
|
|
||||
LL | let x = || {};
|
||||
| ^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | x();
|
||||
| ~~
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,57 +2,54 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/extra_arguments.rs:7:3
|
||||
|
|
||||
LL | empty("");
|
||||
| ^^^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^^^ --
|
||||
| |
|
||||
| unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:1:4
|
||||
|
|
||||
LL | fn empty() {}
|
||||
| ^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | empty();
|
||||
| ~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:9:3
|
||||
|
|
||||
LL | one_arg(1, 1);
|
||||
| ^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg(_a: i32) {}
|
||||
| ^^^^^^^ -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | one_arg(1);
|
||||
| ~~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:10:3
|
||||
|
|
||||
LL | one_arg(1, "");
|
||||
| ^^^^^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg(_a: i32) {}
|
||||
| ^^^^^^^ -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | one_arg(1);
|
||||
| ~~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:11:3
|
||||
|
|
||||
LL | one_arg(1, "", 1.0);
|
||||
| ^^^^^^^ -- --- argument of type `{float}` unexpected
|
||||
| ^^^^^^^ -- --- unexpected argument of type `{float}`
|
||||
| |
|
||||
| argument of type `&'static str` unexpected
|
||||
| unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
@ -61,80 +58,77 @@ LL | fn one_arg(_a: i32) {}
|
|||
| ^^^^^^^ -------
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | one_arg(1);
|
||||
| ~~~
|
||||
LL - one_arg(1, "", 1.0);
|
||||
LL + one_arg(1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:13:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, 1);
|
||||
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_same(1, 1);
|
||||
| ~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:14:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, 1.0);
|
||||
| ^^^^^^^^^^^^ --- argument of type `{float}` unexpected
|
||||
| ^^^^^^^^^^^^ -----
|
||||
| | |
|
||||
| | unexpected argument of type `{float}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_same(1, 1);
|
||||
| ~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:16:3
|
||||
|
|
||||
LL | two_arg_diff(1, 1, "");
|
||||
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:17:3
|
||||
|
|
||||
LL | two_arg_diff(1, "", "");
|
||||
| ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:18:3
|
||||
|
|
||||
LL | two_arg_diff(1, 1, "", "");
|
||||
| ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
|
||||
| |
|
||||
| argument of type `{integer}` unexpected
|
||||
| unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
@ -143,16 +137,17 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
|||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
LL - two_arg_diff(1, 1, "", "");
|
||||
LL + two_arg_diff(1, "");
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:19:3
|
||||
|
|
||||
LL | two_arg_diff(1, "", 1, "");
|
||||
| ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
|
||||
| |
|
||||
| argument of type `{integer}` unexpected
|
||||
| unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
@ -161,78 +156,78 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
|||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
LL - two_arg_diff(1, "", 1, "");
|
||||
LL + two_arg_diff(1, "");
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:22:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, "");
|
||||
| ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^^^^^^ --------
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_same(1, 1);
|
||||
| ~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:23:3
|
||||
|
|
||||
LL | two_arg_diff(1, 1, "");
|
||||
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:24:3
|
||||
|
|
||||
LL | two_arg_same(
|
||||
| ^^^^^^^^^^^^
|
||||
...
|
||||
LL | ""
|
||||
| -- argument of type `&'static str` unexpected
|
||||
LL | two_arg_same(
|
||||
| ^^^^^^^^^^^^
|
||||
LL | 1,
|
||||
LL | 1,
|
||||
| ______-
|
||||
LL | | ""
|
||||
| | --
|
||||
| |_____||
|
||||
| |help: remove the extra argument
|
||||
| unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_same(1, 1);
|
||||
| ~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:30:3
|
||||
|
|
||||
LL | two_arg_diff(
|
||||
| ^^^^^^^^^^^^
|
||||
LL | 1,
|
||||
LL | 1,
|
||||
| - argument of type `{integer}` unexpected
|
||||
LL | two_arg_diff(
|
||||
| ^^^^^^^^^^^^
|
||||
LL | 1,
|
||||
| ______-
|
||||
LL | | 1,
|
||||
| | -
|
||||
| | |
|
||||
| |_____unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_arg_diff(1, "");
|
||||
| ~~~~~~~
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0061]: this function takes 6 arguments but 7 arguments were supplied
|
|||
LL | f(C, A, A, A, B, B, C);
|
||||
| ^ - - - - expected `C`, found `B`
|
||||
| | | |
|
||||
| | | argument of type `A` unexpected
|
||||
| | | unexpected argument of type `A`
|
||||
| | expected `B`, found `A`
|
||||
| expected `A`, found `C`
|
||||
|
|
||||
|
|
@ -64,8 +64,8 @@ error[E0308]: arguments to this function are incorrect
|
|||
LL | f(A, A, D, D, B, B);
|
||||
| ^ - - ---- two arguments of type `C` and `C` are missing
|
||||
| | |
|
||||
| | argument of type `D` unexpected
|
||||
| argument of type `D` unexpected
|
||||
| | unexpected argument of type `D`
|
||||
| unexpected argument of type `D`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-101097.rs:6:4
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied
|
|||
--> $DIR/issue-97484.rs:12:5
|
||||
|
|
||||
LL | foo(&&A, B, C, D, E, F, G);
|
||||
| ^^^ - - - - argument of type `F` unexpected
|
||||
| ^^^ - - - - unexpected argument of type `F`
|
||||
| | | |
|
||||
| | | expected `&E`, found `E`
|
||||
| | argument of type `C` unexpected
|
||||
| argument of type `B` unexpected
|
||||
| | unexpected argument of type `C`
|
||||
| unexpected argument of type `B`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-97484.rs:9:4
|
||||
|
|
@ -19,8 +19,9 @@ LL | foo(&&A, B, C, D, &E, F, G);
|
|||
| ~~
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | foo(&&A, D, /* &E */, G);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~
|
||||
LL - foo(&&A, B, C, D, E, F, G);
|
||||
LL + foo(&&A, D, /* &E */, G);
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
|||
--> $DIR/mixed_cases.rs:10:3
|
||||
|
|
||||
LL | two_args(1, "", X {});
|
||||
| ^^^^^^^^ -- ---- argument of type `X` unexpected
|
||||
| ^^^^^^^^ -- ---- unexpected argument of type `X`
|
||||
| |
|
||||
| expected `f32`, found `&str`
|
||||
|
|
||||
|
|
@ -13,16 +13,17 @@ LL | fn two_args(_a: i32, _b: f32) {}
|
|||
| ^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | two_args(1, /* f32 */);
|
||||
| ~~~~~~~~~~~~~~
|
||||
LL - two_args(1, "", X {});
|
||||
LL + two_args(1, /* f32 */);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 3 arguments but 4 arguments were supplied
|
||||
--> $DIR/mixed_cases.rs:11:3
|
||||
|
|
||||
LL | three_args(1, "", X {}, "");
|
||||
| ^^^^^^^^^^ -- ---- -- argument of type `&'static str` unexpected
|
||||
| ^^^^^^^^^^ -- ---- -- unexpected argument of type `&'static str`
|
||||
| | |
|
||||
| | argument of type `X` unexpected
|
||||
| | unexpected argument of type `X`
|
||||
| an argument of type `f32` is missing
|
||||
|
|
||||
note: function defined here
|
||||
|
|
@ -58,7 +59,7 @@ error[E0308]: arguments to this function are incorrect
|
|||
--> $DIR/mixed_cases.rs:17:3
|
||||
|
|
||||
LL | three_args(1, "", X {});
|
||||
| ^^^^^^^^^^ -- ---- argument of type `X` unexpected
|
||||
| ^^^^^^^^^^ -- ---- unexpected argument of type `X`
|
||||
| |
|
||||
| an argument of type `f32` is missing
|
||||
|
|
||||
|
|
|
|||
|
|
@ -16,17 +16,24 @@ error: lifetime bounds cannot be used in this context
|
|||
LL | type C = for<'b, 'a: 'b +> fn();
|
||||
| ^^
|
||||
|
||||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/bounds-lifetime.rs:4:18
|
||||
|
|
||||
LL | type D = for<'a, T> fn();
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/bounds-lifetime.rs:5:18
|
||||
|
|
||||
LL | type E = dyn for<T> Fn();
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
7
tests/ui/closures/binder/const-bound.rs
Normal file
7
tests/ui/closures/binder/const-bound.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
//~^ WARN is incomplete and may not be safe to use
|
||||
|
||||
fn main() {
|
||||
for<const N: i32> || -> () {};
|
||||
//~^ ERROR late-bound const parameter not allowed on closures
|
||||
}
|
||||
17
tests/ui/closures/binder/const-bound.stderr
Normal file
17
tests/ui/closures/binder/const-bound.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/const-bound.rs:1:37
|
||||
|
|
||||
LL | #![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: late-bound const parameter not allowed on closures
|
||||
--> $DIR/const-bound.rs:5:9
|
||||
|
|
||||
LL | for<const N: i32> || -> () {};
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -1,8 +1,12 @@
|
|||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/disallow-const.rs:4:15
|
||||
|
|
||||
LL | for<const N: i32> || -> () {};
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/disallow-ty.rs:4:9
|
||||
|
|
||||
LL | for<T> || -> () {};
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
7
tests/ui/closures/binder/type-bound-2.rs
Normal file
7
tests/ui/closures/binder/type-bound-2.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
//~^ WARN is incomplete and may not be safe to use
|
||||
|
||||
fn main() {
|
||||
for<T> || -> () {};
|
||||
//~^ ERROR late-bound type parameter not allowed on closures
|
||||
}
|
||||
17
tests/ui/closures/binder/type-bound-2.stderr
Normal file
17
tests/ui/closures/binder/type-bound-2.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/type-bound-2.rs:1:37
|
||||
|
|
||||
LL | #![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: late-bound type parameter not allowed on closures
|
||||
--> $DIR/type-bound-2.rs:5:9
|
||||
|
|
||||
LL | for<T> || -> () {};
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
7
tests/ui/closures/binder/type-bound.rs
Normal file
7
tests/ui/closures/binder/type-bound.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
//~^ WARN is incomplete and may not be safe to use
|
||||
|
||||
fn main() {
|
||||
for<T> || -> T {};
|
||||
//~^ ERROR late-bound type parameter not allowed on closures
|
||||
}
|
||||
17
tests/ui/closures/binder/type-bound.stderr
Normal file
17
tests/ui/closures/binder/type-bound.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/type-bound.rs:1:37
|
||||
|
|
||||
LL | #![feature(closure_lifetime_binder, non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: late-bound type parameter not allowed on closures
|
||||
--> $DIR/type-bound.rs:5:9
|
||||
|
|
||||
LL | for<T> || -> T {};
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -1,21 +1,3 @@
|
|||
error: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:7:45
|
||||
|
|
||||
LL | type FnBad = for<#[cfg(no)] 'a, #[cfg(yes)] T> fn();
|
||||
| ^
|
||||
|
||||
error: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:11:51
|
||||
|
|
||||
LL | type PolyBad = dyn for<#[cfg(no)] 'a, #[cfg(yes)] T> Copy;
|
||||
| ^
|
||||
|
||||
error: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:15:54
|
||||
|
|
||||
LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy;
|
||||
| ^
|
||||
|
||||
error: cannot find attribute `unknown` in this scope
|
||||
--> $DIR/cfg-generic-params.rs:19:29
|
||||
|
|
||||
|
|
@ -46,5 +28,33 @@ error: cannot find attribute `unknown` in this scope
|
|||
LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy;
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:7:45
|
||||
|
|
||||
LL | type FnBad = for<#[cfg(no)] 'a, #[cfg(yes)] T> fn();
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:11:51
|
||||
|
|
||||
LL | type PolyBad = dyn for<#[cfg(no)] 'a, #[cfg(yes)] T> Copy;
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/cfg-generic-params.rs:15:54
|
||||
|
|
||||
LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy;
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,11 @@
|
|||
error[E0015]: cannot call non-const fn `Foo::{constant#0}::Foo::<17>::value` in constants
|
||||
--> $DIR/nested-type.rs:15:5
|
||||
|
|
||||
LL | Foo::<17>::value()
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||
|
||||
error: `[u8; {
|
||||
struct Foo<const N: usize>;
|
||||
|
||||
|
|
@ -24,5 +32,6 @@ LL | | }]>;
|
|||
= note: the only supported types are integers, `bool` and `char`
|
||||
= help: more complex types are supported with `#![feature(adt_const_params)]`
|
||||
|
||||
error: aborting due to previous error
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
|
|||
}
|
||||
|
||||
Foo::<17>::value()
|
||||
//[full]~^ ERROR cannot call non-const fn
|
||||
//~^ ERROR cannot call non-const fn
|
||||
}]>;
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -18,17 +18,16 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/E0057.rs:5:13
|
||||
|
|
||||
LL | let c = f(2, 3);
|
||||
| ^ - argument of type `{integer}` unexpected
|
||||
| ^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/E0057.rs:2:13
|
||||
|
|
||||
LL | let f = |x| x * 3;
|
||||
| ^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let c = f(2);
|
||||
| ~~~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
fn foo() where for<T> T:, {}
|
||||
//~^ ERROR only lifetime parameters can be used in this context
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/feature-gate-non_lifetime_binders.rs:1:20
|
||||
|
|
||||
LL | fn foo() where for<T> T:, {}
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -1,14 +1,21 @@
|
|||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/hrtb-wrong-kind.rs:1:18
|
||||
|
|
||||
LL | fn a() where for<T> T: Copy {}
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: only lifetime parameters can be used in this context
|
||||
error[E0658]: only lifetime parameters can be used in this context
|
||||
--> $DIR/hrtb-wrong-kind.rs:4:24
|
||||
|
|
||||
LL | fn b() where for<const C: usize> [(); C]: Copy {}
|
||||
| ^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/issue-16939.rs:5:9
|
||||
|
|
||||
LL | |t| f(t);
|
||||
| ^ - argument unexpected
|
||||
| ^ -
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: callable defined here
|
||||
--> $DIR/issue-16939.rs:4:12
|
||||
|
|
||||
LL | fn _foo<F: Fn()> (f: F) {
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | |t| f();
|
||||
| ~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
macro_rules! some_macro {
|
||||
($other: expr) => ({
|
||||
$other(None) //~ NOTE argument of type `Option<_>` unexpected
|
||||
$other(None) //~ NOTE unexpected argument of type `Option<_>`
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/issue-26094.rs:10:17
|
||||
|
|
||||
LL | $other(None)
|
||||
| ---- argument of type `Option<_>` unexpected
|
||||
| ----
|
||||
| |
|
||||
| unexpected argument of type `Option<_>`
|
||||
| help: remove the extra argument
|
||||
...
|
||||
LL | some_macro!(some_function);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
@ -12,10 +15,6 @@ note: function defined here
|
|||
|
|
||||
LL | fn some_function() {}
|
||||
| ^^^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | some_function()
|
||||
| ~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/issue-4935.rs:5:13
|
||||
|
|
||||
LL | fn main() { foo(5, 6) }
|
||||
| ^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-4935.rs:3:4
|
||||
|
|
||||
LL | fn foo(a: usize) {}
|
||||
| ^^^ --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | fn main() { foo(5) }
|
||||
| ~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
45
tests/ui/lexer/issue-108019-bad-emoji-recovery.rs
Normal file
45
tests/ui/lexer/issue-108019-bad-emoji-recovery.rs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#![allow(unused_labels)]
|
||||
|
||||
// FIXME(#108019): outdated Unicode table
|
||||
// fn foo() {
|
||||
// '🥺 loop {
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
|
||||
fn bar() {
|
||||
'🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn qux() {
|
||||
'a🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn quux() {
|
||||
'1🐱 loop {
|
||||
//~^ ERROR labeled expression must be followed by `:`
|
||||
//~| ERROR lifetimes or labels cannot start with a number
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fn x<'🐱>() -> &'🐱 () {
|
||||
//~^ ERROR lifetimes or labels cannot contain emojis
|
||||
//~| ERROR lifetimes or labels cannot contain emojis
|
||||
&()
|
||||
}
|
||||
|
||||
fn y() {
|
||||
'a🐱: loop {}
|
||||
//~^ ERROR lifetimes or labels cannot contain emojis
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
86
tests/ui/lexer/issue-108019-bad-emoji-recovery.stderr
Normal file
86
tests/ui/lexer/issue-108019-bad-emoji-recovery.stderr
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:11:5
|
||||
|
|
||||
LL | '🐱 loop {
|
||||
| ^--- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:19:5
|
||||
|
|
||||
LL | 'a🐱 loop {
|
||||
| ^---- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: labeled expression must be followed by `:`
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:27:5
|
||||
|
|
||||
LL | '1🐱 loop {
|
||||
| ^---- help: add `:` after the label
|
||||
| |
|
||||
| _____the label
|
||||
| |
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | break
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:11:5
|
||||
|
|
||||
LL | '🐱 loop {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:19:5
|
||||
|
|
||||
LL | 'a🐱 loop {
|
||||
| ^^^^
|
||||
|
||||
error: lifetimes or labels cannot start with a number
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:27:5
|
||||
|
|
||||
LL | '1🐱 loop {
|
||||
| ^^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:34:6
|
||||
|
|
||||
LL | fn x<'🐱>() -> &'🐱 () {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:34:16
|
||||
|
|
||||
LL | fn x<'🐱>() -> &'🐱 () {
|
||||
| ^^^
|
||||
|
||||
error: lifetimes or labels cannot contain emojis
|
||||
--> $DIR/issue-108019-bad-emoji-recovery.rs:41:5
|
||||
|
|
||||
LL | 'a🐱: loop {}
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
15
tests/ui/lint/issue-108155.rs
Normal file
15
tests/ui/lint/issue-108155.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// check-pass
|
||||
// check that `deref_into_dyn_supertrait` doesn't cause ICE by eagerly converting
|
||||
// a cancelled lint
|
||||
|
||||
#![allow(deref_into_dyn_supertrait)]
|
||||
|
||||
trait Trait {}
|
||||
impl std::ops::Deref for dyn Trait + Send + Sync {
|
||||
type Target = dyn Trait;
|
||||
fn deref(&self) -> &Self::Target {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -2,17 +2,16 @@ error[E0061]: this method takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/method-call-err-msg.rs:13:7
|
||||
|
|
||||
LL | x.zero(0)
|
||||
| ^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^ -
|
||||
| |
|
||||
| unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-call-err-msg.rs:5:8
|
||||
|
|
||||
LL | fn zero(self) -> Foo { self }
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | x.zero()
|
||||
| ~~
|
||||
|
||||
error[E0061]: this method takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/method-call-err-msg.rs:14:7
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/overloaded-calls-bad.rs:37:15
|
||||
|
|
||||
LL | let ans = s("burma", "shave");
|
||||
| ^ ------- ------- argument of type `&'static str` unexpected
|
||||
| ^ ------- ------- unexpected argument of type `&'static str`
|
||||
| |
|
||||
| expected `isize`, found `&str`
|
||||
|
|
||||
|
|
@ -43,8 +43,9 @@ LL | impl FnMut<(isize,)> for S {
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let ans = s(/* isize */);
|
||||
| ~~~~~~~~~~~~~
|
||||
LL - let ans = s("burma", "shave");
|
||||
LL + let ans = s(/* isize */);
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/overloaded-calls-bad.rs:40:7
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
struct S<'1> { s: &'1 usize }
|
||||
//~^ ERROR lifetimes cannot start with a number
|
||||
//~| ERROR lifetimes cannot start with a number
|
||||
//~^ ERROR lifetimes or labels cannot start with a number
|
||||
//~| ERROR lifetimes or labels cannot start with a number
|
||||
fn main() {
|
||||
// verify that the parse error doesn't stop type checking
|
||||
let x: usize = "";
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ LL | let x: usize = "";
|
|||
| |
|
||||
| expected due to this
|
||||
|
||||
error: lifetimes cannot start with a number
|
||||
error: lifetimes or labels cannot start with a number
|
||||
--> $DIR/numeric-lifetime.rs:1:10
|
||||
|
|
||||
LL | struct S<'1> { s: &'1 usize }
|
||||
| ^^
|
||||
|
||||
error: lifetimes cannot start with a number
|
||||
error: lifetimes or labels cannot start with a number
|
||||
--> $DIR/numeric-lifetime.rs:1:20
|
||||
|
|
||||
LL | struct S<'1> { s: &'1 usize }
|
||||
|
|
|
|||
|
|
@ -88,12 +88,6 @@ error: expected identifier, found `>`
|
|||
LL | type QuiteBroken = fn<const>();
|
||||
| ^ expected identifier
|
||||
|
||||
error: lifetime bounds cannot be used in this context
|
||||
--> $DIR/recover-fn-ptr-with-generics.rs:22:26
|
||||
|
|
||||
LL | let _: extern fn<'a: 'static>();
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0412]: cannot find type `T` in this scope
|
||||
--> $DIR/recover-fn-ptr-with-generics.rs:5:27
|
||||
|
|
||||
|
|
@ -106,6 +100,12 @@ error[E0412]: cannot find type `T` in this scope
|
|||
LL | type Identity = fn<T>(T) -> T;
|
||||
| ^ not found in this scope
|
||||
|
||||
error: lifetime bounds cannot be used in this context
|
||||
--> $DIR/recover-fn-ptr-with-generics.rs:22:26
|
||||
|
|
||||
LL | let _: extern fn<'a: 'static>();
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0412`.
|
||||
|
|
|
|||
52
tests/ui/repr/16-bit-repr-c-enum.rs
Normal file
52
tests/ui/repr/16-bit-repr-c-enum.rs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
// build-pass
|
||||
// revisions: avr msp430
|
||||
//
|
||||
// [avr] needs-llvm-components: avr
|
||||
// [avr] compile-flags: --target=avr-unknown-gnu-atmega328 --crate-type=rlib
|
||||
// [msp430] needs-llvm-components: msp430
|
||||
// [msp430] compile-flags: --target=msp430-none-elf --crate-type=rlib
|
||||
#![feature(no_core, lang_items, intrinsics, staged_api)]
|
||||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
#![stable(feature = "", since = "")]
|
||||
#![allow(dead_code)]
|
||||
|
||||
// Test that the repr(C) attribute doesn't break compilation
|
||||
// Previous bad assumption was that 32-bit enum default width is fine on msp430, avr
|
||||
// But the width of the C int on these platforms is 16 bits, and C enums <= C int range
|
||||
// so we want no more than that, usually. This resulted in errors like
|
||||
// "layout decided on a larger discriminant type (I32) than typeck (I16)"
|
||||
#[repr(C)]
|
||||
enum Foo {
|
||||
Bar,
|
||||
}
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
#[stable(feature = "", since = "")]
|
||||
#[rustc_const_stable(feature = "", since = "")]
|
||||
#[rustc_safe_intrinsic]
|
||||
fn size_of<T>() -> usize;
|
||||
}
|
||||
|
||||
#[lang="sized"]
|
||||
trait Sized {}
|
||||
#[lang="copy"]
|
||||
trait Copy {}
|
||||
|
||||
const EXPECTED: usize = 2;
|
||||
const ACTUAL: usize = size_of::<Foo>();
|
||||
// Validate that the size is indeed 16 bits, to match this C static_assert:
|
||||
/**
|
||||
```c
|
||||
#include <assert.h>
|
||||
enum foo {
|
||||
BAR
|
||||
};
|
||||
int main(void)
|
||||
{
|
||||
/* passes on msp430-elf-gcc */
|
||||
static_assert(sizeof(enum foo) == 2);
|
||||
}
|
||||
```
|
||||
*/
|
||||
const _: [(); EXPECTED] = [(); ACTUAL];
|
||||
|
|
@ -24,14 +24,13 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/resolve-primitive-fallback.rs:3:5
|
||||
|
|
||||
LL | std::mem::size_of(u16);
|
||||
| ^^^^^^^^^^^^^^^^^ --- argument unexpected
|
||||
| ^^^^^^^^^^^^^^^^^ ---
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | std::mem::size_of();
|
||||
| ~~
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
28
tests/ui/sanitize/cfg-kasan.rs
Normal file
28
tests/ui/sanitize/cfg-kasan.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Verifies that when compiling with -Zsanitizer=kernel-address,
|
||||
// the `#[cfg(sanitize = "address")]` attribute is configured.
|
||||
|
||||
// check-pass
|
||||
// compile-flags: -Zsanitizer=kernel-address --cfg kernel_address
|
||||
// revisions: aarch64 riscv64imac riscv64gc x86_64
|
||||
//[aarch64] compile-flags: --target aarch64-unknown-none
|
||||
//[aarch64] needs-llvm-components: aarch64
|
||||
//[riscv64imac] compile-flags: --target riscv64imac-unknown-none-elf
|
||||
//[riscv64imac] needs-llvm-components: riscv
|
||||
//[riscv64imac] min-llvm-version: 16
|
||||
//[riscv64gc] compile-flags: --target riscv64gc-unknown-none-elf
|
||||
//[riscv64gc] needs-llvm-components: riscv
|
||||
//[riscv64gc] min-llvm-version: 16
|
||||
//[x86_64] compile-flags: --target x86_64-unknown-none
|
||||
//[x86_64] needs-llvm-components: x86
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
#![feature(cfg_sanitize, no_core, lang_items)]
|
||||
#![no_core]
|
||||
|
||||
#[lang = "sized"]
|
||||
trait Sized {}
|
||||
|
||||
const _: fn() -> () = main;
|
||||
|
||||
#[cfg(all(sanitize = "address", kernel_address))]
|
||||
fn main() {}
|
||||
|
|
@ -54,17 +54,16 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
|||
--> $DIR/issue-34264.rs:7:5
|
||||
|
|
||||
LL | foo(Some(42), 2, "");
|
||||
| ^^^ -- argument of type `&'static str` unexpected
|
||||
| ^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-34264.rs:1:4
|
||||
|
|
||||
LL | fn foo(Option<i32>, String) {}
|
||||
| ^^^ ----------- ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | foo(Some(42), 2);
|
||||
| ~~~~~~~~~~~~~
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-34264.rs:8:13
|
||||
|
|
@ -84,17 +83,16 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
|||
--> $DIR/issue-34264.rs:10:5
|
||||
|
|
||||
LL | bar(1, 2, 3);
|
||||
| ^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-34264.rs:3:4
|
||||
|
|
||||
LL | fn bar(x, y: usize) {}
|
||||
| ^^^ - --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | bar(1, 2);
|
||||
| ~~~~~~
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/args-instead-of-tuple-errors.rs:6:34
|
||||
|
|
||||
LL | let _: Option<(i32, bool)> = Some(1, 2);
|
||||
| ^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: expected `(i32, bool)`, found integer
|
||||
--> $DIR/args-instead-of-tuple-errors.rs:6:39
|
||||
|
|
@ -22,14 +22,15 @@ note: tuple variant defined here
|
|||
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let _: Option<(i32, bool)> = Some(/* (i32, bool) */);
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
LL - let _: Option<(i32, bool)> = Some(1, 2);
|
||||
LL + let _: Option<(i32, bool)> = Some(/* (i32, bool) */);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/args-instead-of-tuple-errors.rs:8:5
|
||||
|
|
||||
LL | int_bool(1, 2);
|
||||
| ^^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: expected `(i32, bool)`, found integer
|
||||
--> $DIR/args-instead-of-tuple-errors.rs:8:14
|
||||
|
|
@ -45,8 +46,9 @@ LL | fn int_bool(_: (i32, bool)) {
|
|||
| ^^^^^^^^ --------------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | int_bool(/* (i32, bool) */);
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
LL - int_bool(1, 2);
|
||||
LL + int_bool(/* (i32, bool) */);
|
||||
|
|
||||
|
||||
error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/args-instead-of-tuple-errors.rs:11:28
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
// Regression test for #108072: do not ICE upon unmet trait alias constraint
|
||||
|
||||
#![feature(trait_alias)]
|
||||
|
||||
trait IteratorAlias = Iterator;
|
||||
|
||||
fn f(_: impl IteratorAlias) {}
|
||||
|
||||
fn main() {
|
||||
f(()) //~ `()` is not an iterator
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
error[E0277]: `()` is not an iterator
|
||||
--> $DIR/issue-108072-unmet-trait-alias-bound.rs:10:7
|
||||
|
|
||||
LL | f(())
|
||||
| - ^^ `()` is not an iterator
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `Iterator` is not implemented for `()`
|
||||
= note: required for `()` to implement `IteratorAlias`
|
||||
note: required by a bound in `f`
|
||||
--> $DIR/issue-108072-unmet-trait-alias-bound.rs:7:14
|
||||
|
|
||||
LL | fn f(_: impl IteratorAlias) {}
|
||||
| ^^^^^^^^^^^^^ required by this bound in `f`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
// Regression test for #108132: do not ICE upon unmet trait alias constraint in generic impl
|
||||
|
||||
#![feature(trait_alias)]
|
||||
|
||||
trait IteratorAlias = Iterator;
|
||||
|
||||
struct Foo<I>(I);
|
||||
|
||||
impl<I: IteratorAlias> Foo<I> {
|
||||
fn f() {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Foo::<()>::f() //~ trait bounds were not satisfied
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
error[E0599]: the function or associated item `f` exists for struct `Foo<()>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs:14:16
|
||||
|
|
||||
LL | struct Foo<I>(I);
|
||||
| ------------- function or associated item `f` not found for this struct
|
||||
...
|
||||
LL | Foo::<()>::f()
|
||||
| ^ function or associated item cannot be called on `Foo<()>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: trait bound `(): Iterator` was not satisfied
|
||||
--> $DIR/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs:5:23
|
||||
|
|
||||
LL | trait IteratorAlias = Iterator;
|
||||
| ------------- ^^^^^^^^ unsatisfied trait bound introduced here
|
||||
note: trait bound `(): IteratorAlias` was not satisfied
|
||||
--> $DIR/issue-108132-unmet-trait-alias-bound-on-generic-impl.rs:9:9
|
||||
|
|
||||
LL | impl<I: IteratorAlias> Foo<I> {
|
||||
| ^^^^^^^^^^^^^ ------
|
||||
| |
|
||||
| unsatisfied trait bound introduced here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0599`.
|
||||
19
tests/ui/traits/non_lifetime_binders/basic.rs
Normal file
19
tests/ui/traits/non_lifetime_binders/basic.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// check-pass
|
||||
// Basic test that show's we can succesfully typeck a `for<T>` where clause.
|
||||
|
||||
#![feature(non_lifetime_binders)]
|
||||
//~^ WARN the feature `non_lifetime_binders` is incomplete
|
||||
|
||||
trait Trait {}
|
||||
|
||||
impl<T: ?Sized> Trait for T {}
|
||||
|
||||
fn foo()
|
||||
where
|
||||
for<T> T: Trait,
|
||||
{
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo();
|
||||
}
|
||||
11
tests/ui/traits/non_lifetime_binders/basic.stderr
Normal file
11
tests/ui/traits/non_lifetime_binders/basic.stderr
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/basic.rs:4:12
|
||||
|
|
||||
LL | #![feature(non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
23
tests/ui/traits/non_lifetime_binders/fail.rs
Normal file
23
tests/ui/traits/non_lifetime_binders/fail.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// Error reporting for where `for<T> T: Trait` doesn't hold
|
||||
|
||||
#![feature(non_lifetime_binders)]
|
||||
//~^ WARN the feature `non_lifetime_binders` is incomplete
|
||||
|
||||
trait Trait {}
|
||||
|
||||
fn fail()
|
||||
where
|
||||
for<T> T: Trait,
|
||||
{}
|
||||
|
||||
fn auto_trait()
|
||||
where
|
||||
for<T> T: Send,
|
||||
{}
|
||||
|
||||
fn main() {
|
||||
fail();
|
||||
//~^ ERROR the trait bound `T: Trait` is not satisfied
|
||||
auto_trait();
|
||||
//~^ ERROR `T` cannot be sent between threads safely
|
||||
}
|
||||
43
tests/ui/traits/non_lifetime_binders/fail.stderr
Normal file
43
tests/ui/traits/non_lifetime_binders/fail.stderr
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/fail.rs:3:12
|
||||
|
|
||||
LL | #![feature(non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error[E0277]: the trait bound `T: Trait` is not satisfied
|
||||
--> $DIR/fail.rs:19:5
|
||||
|
|
||||
LL | fail();
|
||||
| ^^^^ the trait `Trait` is not implemented for `T`
|
||||
|
|
||||
note: required by a bound in `fail`
|
||||
--> $DIR/fail.rs:10:15
|
||||
|
|
||||
LL | fn fail()
|
||||
| ---- required by a bound in this
|
||||
LL | where
|
||||
LL | for<T> T: Trait,
|
||||
| ^^^^^ required by this bound in `fail`
|
||||
|
||||
error[E0277]: `T` cannot be sent between threads safely
|
||||
--> $DIR/fail.rs:21:5
|
||||
|
|
||||
LL | auto_trait();
|
||||
| ^^^^^^^^^^ `T` cannot be sent between threads safely
|
||||
|
|
||||
= help: the trait `Send` is not implemented for `T`
|
||||
note: required by a bound in `auto_trait`
|
||||
--> $DIR/fail.rs:15:15
|
||||
|
|
||||
LL | fn auto_trait()
|
||||
| ---------- required by a bound in this
|
||||
LL | where
|
||||
LL | for<T> T: Send,
|
||||
| ^^^^ required by this bound in `auto_trait`
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
13
tests/ui/traits/non_lifetime_binders/on-dyn.rs
Normal file
13
tests/ui/traits/non_lifetime_binders/on-dyn.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Tests to make sure that we reject polymorphic dyn trait.
|
||||
|
||||
#![feature(non_lifetime_binders)]
|
||||
//~^ WARN the feature `non_lifetime_binders` is incomplete
|
||||
|
||||
trait Test<T> {}
|
||||
|
||||
fn foo() -> &'static dyn for<T> Test<T> {
|
||||
//~^ ERROR late-bound type parameter not allowed on trait object types
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
17
tests/ui/traits/non_lifetime_binders/on-dyn.stderr
Normal file
17
tests/ui/traits/non_lifetime_binders/on-dyn.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/on-dyn.rs:3:12
|
||||
|
|
||||
LL | #![feature(non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: late-bound type parameter not allowed on trait object types
|
||||
--> $DIR/on-dyn.rs:8:30
|
||||
|
|
||||
LL | fn foo() -> &'static dyn for<T> Test<T> {
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
13
tests/ui/traits/non_lifetime_binders/on-ptr.rs
Normal file
13
tests/ui/traits/non_lifetime_binders/on-ptr.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Tests to make sure that we reject polymorphic fn ptrs.
|
||||
|
||||
#![feature(non_lifetime_binders)]
|
||||
//~^ WARN the feature `non_lifetime_binders` is incomplete
|
||||
|
||||
fn foo() -> for<T> fn(T) {
|
||||
//~^ ERROR late-bound type parameter not allowed on function pointer types
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo()(1i32);
|
||||
}
|
||||
17
tests/ui/traits/non_lifetime_binders/on-ptr.stderr
Normal file
17
tests/ui/traits/non_lifetime_binders/on-ptr.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/on-ptr.rs:3:12
|
||||
|
|
||||
LL | #![feature(non_lifetime_binders)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: late-bound type parameter not allowed on function pointer types
|
||||
--> $DIR/on-ptr.rs:6:17
|
||||
|
|
||||
LL | fn foo() -> for<T> fn(T) {
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ error[E0061]: this method takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/wrong_argument_ice-3.rs:9:16
|
||||
|
|
||||
LL | groups.push(new_group, vec![process]);
|
||||
| ^^^^ ------------- argument of type `Vec<&Process>` unexpected
|
||||
| ^^^^ ------------- unexpected argument of type `Vec<&Process>`
|
||||
|
|
||||
note: expected `(Vec<String>, Vec<Process>)`, found `Vec<String>`
|
||||
--> $DIR/wrong_argument_ice-3.rs:9:21
|
||||
|
|
@ -15,8 +15,9 @@ note: associated function defined here
|
|||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | groups.push(/* (Vec<String>, Vec<Process>) */);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LL - groups.push(new_group, vec![process]);
|
||||
LL + groups.push(/* (Vec<String>, Vec<Process>) */);
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -6,17 +6,16 @@ LL | (|| {})(|| {
|
|||
LL | |
|
||||
LL | | let b = 1;
|
||||
LL | | });
|
||||
| |_____- argument of type `[closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15]` unexpected
|
||||
| | -
|
||||
| | |
|
||||
| |_____unexpected argument of type `[closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15]`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/wrong_argument_ice-4.rs:2:6
|
||||
|
|
||||
LL | (|| {})(|| {
|
||||
| ^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | (|| {})();
|
||||
| ~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -11,14 +11,13 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/type-ascription-instead-of-initializer.rs:2:12
|
||||
|
|
||||
LL | let x: Vec::with_capacity(10, 20);
|
||||
| ^^^^^^^^^^^^^^^^^^ -- argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^^^^^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let x: Vec::with_capacity(10);
|
||||
| ~~~~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,16 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/remove-extra-argument.rs:6:5
|
||||
|
|
||||
LL | l(vec![], vec![])
|
||||
| ^ ------ argument of type `Vec<_>` unexpected
|
||||
| ^ --------
|
||||
| | |
|
||||
| | unexpected argument of type `Vec<_>`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/remove-extra-argument.rs:3:4
|
||||
|
|
||||
LL | fn l(_a: Vec<u8>) {}
|
||||
| ^ -----------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | l(vec![])
|
||||
| ~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,29 +2,29 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/struct-enum-wrong-args.rs:6:13
|
||||
|
|
||||
LL | let _ = Some(3, 2);
|
||||
| ^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: tuple variant defined here
|
||||
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let _ = Some(3);
|
||||
| ~~~
|
||||
|
||||
error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:7:13
|
||||
|
|
||||
LL | let _ = Ok(3, 6, 2);
|
||||
| ^^ - - argument of type `{integer}` unexpected
|
||||
| ^^ - - unexpected argument of type `{integer}`
|
||||
| |
|
||||
| argument of type `{integer}` unexpected
|
||||
| unexpected argument of type `{integer}`
|
||||
|
|
||||
note: tuple variant defined here
|
||||
--> $SRC_DIR/core/src/result.rs:LL:COL
|
||||
help: remove the extra arguments
|
||||
|
|
||||
LL | let _ = Ok(3);
|
||||
| ~~~
|
||||
LL - let _ = Ok(3, 6, 2);
|
||||
LL + let _ = Ok(3);
|
||||
|
|
||||
|
||||
error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:8:13
|
||||
|
|
@ -59,17 +59,16 @@ error[E0061]: this struct takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/struct-enum-wrong-args.rs:10:13
|
||||
|
|
||||
LL | let _ = Wrapper(5, 2);
|
||||
| ^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: tuple struct defined here
|
||||
--> $DIR/struct-enum-wrong-args.rs:2:8
|
||||
|
|
||||
LL | struct Wrapper(i32);
|
||||
| ^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let _ = Wrapper(5);
|
||||
| ~~~
|
||||
|
||||
error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:11:13
|
||||
|
|
@ -107,17 +106,16 @@ error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
|
|||
--> $DIR/struct-enum-wrong-args.rs:13:13
|
||||
|
|
||||
LL | let _ = DoubleWrapper(5, 2, 7);
|
||||
| ^^^^^^^^^^^^^ - argument of type `{integer}` unexpected
|
||||
| ^^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
|
|
||||
note: tuple struct defined here
|
||||
--> $DIR/struct-enum-wrong-args.rs:3:8
|
||||
|
|
||||
LL | struct DoubleWrapper(i32, i32);
|
||||
| ^^^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let _ = DoubleWrapper(5, 2);
|
||||
| ~~~~~~
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue