diff options
Diffstat (limited to 'tests')
169 files changed, 861 insertions, 1463 deletions
diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff new file mode 100644 index 00000000000..50189d192ce --- /dev/null +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff @@ -0,0 +1,123 @@ +- // MIR for `main` before GVN ++ // MIR for `main` after GVN + + fn main() -> () { + let mut _0: (); + let _1: std::alloc::Layout; + let mut _2: std::option::Option<std::alloc::Layout>; + let mut _3: *mut u8; + let mut _4: *mut [u8]; + let mut _5: std::ptr::NonNull<[u8]>; + let mut _6: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>; + let mut _7: &std::alloc::Global; + let mut _8: std::alloc::Layout; + scope 1 { + debug layout => _1; + let mut _9: &std::alloc::Global; + scope 2 { + debug ptr => _3; + } + scope 5 (inlined <std::alloc::Global as Allocator>::allocate) { + debug self => _9; + debug layout => _1; + } + scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) { + debug self => _6; + let mut _12: isize; + let _13: std::alloc::AllocError; + let mut _14: !; + let _15: &str; + let mut _16: &dyn std::fmt::Debug; + let mut _17: &std::alloc::AllocError; + scope 7 { + debug t => _5; + } + scope 8 { + debug e => const std::alloc::AllocError; + } + } + scope 9 (inlined NonNull::<[u8]>::as_ptr) { + debug self => _5; + let mut _18: *const [u8]; + } + } + scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) { + debug self => _2; + let mut _10: isize; + let mut _11: !; + scope 4 { + debug val => _1; + } + } + + bb0: { + StorageLive(_2); +- _2 = Option::<Layout>::None; ++ _2 = const Option::<Layout>::None; + StorageLive(_10); + _10 = const 0_isize; + switchInt(const 0_isize) -> [0: bb1, 1: bb3, otherwise: bb2]; + } + + bb1: { + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable; + } + + bb2: { + unreachable; + } + + bb3: { +- _1 = move ((_2 as Some).0: std::alloc::Layout); ++ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): ptr::alignment::AlignmentEnum32) }}; + StorageDead(_10); + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _9 = const _; +- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb4, unwind unreachable]; + } + + bb4: { + StorageLive(_12); + StorageLive(_15); + _12 = discriminant(_6); + switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb2]; + } + + bb5: { + _15 = const "called `Result::unwrap()` on an `Err` value"; + StorageLive(_16); + StorageLive(_17); + _17 = &_13; + _16 = move _17 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + StorageDead(_17); + _14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable; + } + + bb6: { + _5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>); + StorageDead(_15); + StorageDead(_12); + StorageDead(_6); + StorageLive(_18); + _18 = (_5.0: *const [u8]); + _4 = move _18 as *mut [u8] (PtrToPtr); + StorageDead(_18); + StorageDead(_5); + _3 = move _4 as *mut u8 (PtrToPtr); + StorageDead(_4); + StorageDead(_3); + return; + } + } ++ ++ ALLOC0 (size: 8, align: 4) { ++ 00 00 00 00 __ __ __ __ │ ....░░░░ ++ } ++ ++ ALLOC1 (size: 0, align: 1) {} + diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff new file mode 100644 index 00000000000..6966762a1b8 --- /dev/null +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-unwind.diff @@ -0,0 +1,92 @@ +- // MIR for `main` before GVN ++ // MIR for `main` after GVN + + fn main() -> () { + let mut _0: (); + let _1: std::alloc::Layout; + let mut _2: std::option::Option<std::alloc::Layout>; + let mut _3: *mut u8; + let mut _4: *mut [u8]; + let mut _5: std::ptr::NonNull<[u8]>; + let mut _6: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>; + let mut _7: &std::alloc::Global; + let mut _8: std::alloc::Layout; + scope 1 { + debug layout => _1; + let mut _9: &std::alloc::Global; + scope 2 { + debug ptr => _3; + } + scope 5 (inlined <std::alloc::Global as Allocator>::allocate) { + debug self => _9; + debug layout => _1; + } + scope 6 (inlined NonNull::<[u8]>::as_ptr) { + debug self => _5; + let mut _12: *const [u8]; + } + } + scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) { + debug self => _2; + let mut _10: isize; + let mut _11: !; + scope 4 { + debug val => _1; + } + } + + bb0: { + StorageLive(_2); +- _2 = Option::<Layout>::None; ++ _2 = const Option::<Layout>::None; + StorageLive(_10); + _10 = const 0_isize; + switchInt(const 0_isize) -> [0: bb2, 1: bb4, otherwise: bb3]; + } + + bb1: { + StorageDead(_6); + StorageLive(_12); + _12 = (_5.0: *const [u8]); + _4 = move _12 as *mut [u8] (PtrToPtr); + StorageDead(_12); + StorageDead(_5); + _3 = move _4 as *mut u8 (PtrToPtr); + StorageDead(_4); + StorageDead(_3); + return; + } + + bb2: { + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind continue; + } + + bb3: { + unreachable; + } + + bb4: { +- _1 = move ((_2 as Some).0: std::alloc::Layout); ++ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): ptr::alignment::AlignmentEnum32) }}; + StorageDead(_10); + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _9 = const _; +- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x00000000): ptr::alignment::AlignmentEnum32) }}, const false) -> [return: bb5, unwind continue]; + } + + bb5: { + _5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue]; + } + } ++ ++ ALLOC0 (size: 8, align: 4) { ++ 00 00 00 00 __ __ __ __ │ ....░░░░ ++ } ++ ++ ALLOC1 (size: 0, align: 1) {} + diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff new file mode 100644 index 00000000000..08a185bad9c --- /dev/null +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-abort.diff @@ -0,0 +1,123 @@ +- // MIR for `main` before GVN ++ // MIR for `main` after GVN + + fn main() -> () { + let mut _0: (); + let _1: std::alloc::Layout; + let mut _2: std::option::Option<std::alloc::Layout>; + let mut _3: *mut u8; + let mut _4: *mut [u8]; + let mut _5: std::ptr::NonNull<[u8]>; + let mut _6: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>; + let mut _7: &std::alloc::Global; + let mut _8: std::alloc::Layout; + scope 1 { + debug layout => _1; + let mut _9: &std::alloc::Global; + scope 2 { + debug ptr => _3; + } + scope 5 (inlined <std::alloc::Global as Allocator>::allocate) { + debug self => _9; + debug layout => _1; + } + scope 6 (inlined #[track_caller] Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap) { + debug self => _6; + let mut _12: isize; + let _13: std::alloc::AllocError; + let mut _14: !; + let _15: &str; + let mut _16: &dyn std::fmt::Debug; + let mut _17: &std::alloc::AllocError; + scope 7 { + debug t => _5; + } + scope 8 { + debug e => const std::alloc::AllocError; + } + } + scope 9 (inlined NonNull::<[u8]>::as_ptr) { + debug self => _5; + let mut _18: *const [u8]; + } + } + scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) { + debug self => _2; + let mut _10: isize; + let mut _11: !; + scope 4 { + debug val => _1; + } + } + + bb0: { + StorageLive(_2); +- _2 = Option::<Layout>::None; ++ _2 = const Option::<Layout>::None; + StorageLive(_10); + _10 = const 0_isize; + switchInt(const 0_isize) -> [0: bb1, 1: bb3, otherwise: bb2]; + } + + bb1: { + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind unreachable; + } + + bb2: { + unreachable; + } + + bb3: { +- _1 = move ((_2 as Some).0: std::alloc::Layout); ++ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): ptr::alignment::AlignmentEnum64) }}; + StorageDead(_10); + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _9 = const _; +- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb4, unwind unreachable]; ++ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb4, unwind unreachable]; + } + + bb4: { + StorageLive(_12); + StorageLive(_15); + _12 = discriminant(_6); + switchInt(move _12) -> [0: bb6, 1: bb5, otherwise: bb2]; + } + + bb5: { + _15 = const "called `Result::unwrap()` on an `Err` value"; + StorageLive(_16); + StorageLive(_17); + _17 = &_13; + _16 = move _17 as &dyn std::fmt::Debug (PointerCoercion(Unsize)); + StorageDead(_17); + _14 = result::unwrap_failed(move _15, move _16) -> unwind unreachable; + } + + bb6: { + _5 = move ((_6 as Ok).0: std::ptr::NonNull<[u8]>); + StorageDead(_15); + StorageDead(_12); + StorageDead(_6); + StorageLive(_18); + _18 = (_5.0: *const [u8]); + _4 = move _18 as *mut [u8] (PtrToPtr); + StorageDead(_18); + StorageDead(_5); + _3 = move _4 as *mut u8 (PtrToPtr); + StorageDead(_4); + StorageDead(_3); + return; + } + } ++ ++ ALLOC0 (size: 16, align: 8) { ++ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░ ++ } ++ ++ ALLOC1 (size: 0, align: 1) {} + diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff new file mode 100644 index 00000000000..6501cb85e8a --- /dev/null +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.64bit.panic-unwind.diff @@ -0,0 +1,92 @@ +- // MIR for `main` before GVN ++ // MIR for `main` after GVN + + fn main() -> () { + let mut _0: (); + let _1: std::alloc::Layout; + let mut _2: std::option::Option<std::alloc::Layout>; + let mut _3: *mut u8; + let mut _4: *mut [u8]; + let mut _5: std::ptr::NonNull<[u8]>; + let mut _6: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>; + let mut _7: &std::alloc::Global; + let mut _8: std::alloc::Layout; + scope 1 { + debug layout => _1; + let mut _9: &std::alloc::Global; + scope 2 { + debug ptr => _3; + } + scope 5 (inlined <std::alloc::Global as Allocator>::allocate) { + debug self => _9; + debug layout => _1; + } + scope 6 (inlined NonNull::<[u8]>::as_ptr) { + debug self => _5; + let mut _12: *const [u8]; + } + } + scope 3 (inlined #[track_caller] Option::<Layout>::unwrap) { + debug self => _2; + let mut _10: isize; + let mut _11: !; + scope 4 { + debug val => _1; + } + } + + bb0: { + StorageLive(_2); +- _2 = Option::<Layout>::None; ++ _2 = const Option::<Layout>::None; + StorageLive(_10); + _10 = const 0_isize; + switchInt(const 0_isize) -> [0: bb2, 1: bb4, otherwise: bb3]; + } + + bb1: { + StorageDead(_6); + StorageLive(_12); + _12 = (_5.0: *const [u8]); + _4 = move _12 as *mut [u8] (PtrToPtr); + StorageDead(_12); + StorageDead(_5); + _3 = move _4 as *mut u8 (PtrToPtr); + StorageDead(_4); + StorageDead(_3); + return; + } + + bb2: { + _11 = core::panicking::panic(const "called `Option::unwrap()` on a `None` value") -> unwind continue; + } + + bb3: { + unreachable; + } + + bb4: { +- _1 = move ((_2 as Some).0: std::alloc::Layout); ++ _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): ptr::alignment::AlignmentEnum64) }}; + StorageDead(_10); + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + StorageLive(_5); + StorageLive(_6); + _9 = const _; +- _6 = std::alloc::Global::alloc_impl(_9, _1, const false) -> [return: bb5, unwind continue]; ++ _6 = std::alloc::Global::alloc_impl(const {ALLOC1: &std::alloc::Global}, const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(8 bytes) }: usize, align: std::ptr::Alignment(Scalar(0x0000000000000000): ptr::alignment::AlignmentEnum64) }}, const false) -> [return: bb5, unwind continue]; + } + + bb5: { + _5 = Result::<NonNull<[u8]>, std::alloc::AllocError>::unwrap(move _6) -> [return: bb1, unwind continue]; + } + } ++ ++ ALLOC0 (size: 16, align: 8) { ++ 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░ ++ } ++ ++ ALLOC1 (size: 0, align: 1) {} + diff --git a/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs new file mode 100644 index 00000000000..c92424f2983 --- /dev/null +++ b/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs @@ -0,0 +1,15 @@ +// Verify that we do not ICE when printing an invalid constant. +// EMIT_MIR_FOR_EACH_BIT_WIDTH +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY + +#![feature(allocator_api)] + +use std::alloc::{Allocator, Global, Layout}; + +// EMIT_MIR issue_117368_print_invalid_constant.main.GVN.diff +fn main() { + // CHECK-LABEL: fn main( + // CHECK: debug layout => const Layout + let layout: Layout = None.unwrap(); + let ptr: *mut u8 = Global.allocate(layout).unwrap().as_ptr() as _; +} diff --git a/tests/run-make-fulldeps/issue-19371/foo.rs b/tests/run-make-fulldeps/issue-19371/foo.rs index 71009d32477..1a94649163b 100644 --- a/tests/run-make-fulldeps/issue-19371/foo.rs +++ b/tests/run-make-fulldeps/issue-19371/foo.rs @@ -7,7 +7,7 @@ extern crate rustc_span; use rustc_interface::interface; use rustc_session::config::{Input, Options, OutFileName, OutputType, OutputTypes}; -use rustc_span::source_map::FileName; +use rustc_span::FileName; use std::path::PathBuf; diff --git a/tests/run-make/crate-hash-rustc-version/Makefile b/tests/run-make/crate-hash-rustc-version/Makefile index f1d2a360410..6bf504bf01b 100644 --- a/tests/run-make/crate-hash-rustc-version/Makefile +++ b/tests/run-make/crate-hash-rustc-version/Makefile @@ -4,7 +4,7 @@ include ../tools.mk # Ensure that crates compiled with different rustc versions cannot # be dynamically linked. -FLAGS := -Cprefer-dynamic -Zsymbol-mangling-version=v0 +FLAGS := -Cprefer-dynamic -Csymbol-mangling-version=v0 UNAME := $(shell uname) ifeq ($(UNAME),Linux) EXT=".so" diff --git a/tests/run-make/use-extern-for-plugins/Makefile b/tests/run-make/use-extern-for-plugins/Makefile deleted file mode 100644 index b8ec7e8dcda..00000000000 --- a/tests/run-make/use-extern-for-plugins/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -include ../tools.mk - -# ignore-freebsd -# ignore-openbsd -# ignore-solaris - -HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //') -ifeq ($(findstring i686,$(HOST)),i686) -TARGET := $(subst i686,x86_64,$(HOST)) -else -TARGET := $(subst x86_64,i686,$(HOST)) -endif - -all: - $(RUSTC) foo.rs -C extra-filename=-host - $(RUSTC) bar.rs -C extra-filename=-targ --target $(TARGET) - $(RUSTC) baz.rs --extern a=$(TMPDIR)/liba-targ.rlib --target $(TARGET) diff --git a/tests/run-make/use-extern-for-plugins/bar.rs b/tests/run-make/use-extern-for-plugins/bar.rs deleted file mode 100644 index 704d2120362..00000000000 --- a/tests/run-make/use-extern-for-plugins/bar.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(no_core)] -#![no_core] -#![crate_type = "lib"] -#![crate_name = "a"] - -#[macro_export] -macro_rules! bar { - () => () -} diff --git a/tests/run-make/use-extern-for-plugins/baz.rs b/tests/run-make/use-extern-for-plugins/baz.rs deleted file mode 100644 index 49a96a0c80b..00000000000 --- a/tests/run-make/use-extern-for-plugins/baz.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(no_core)] -#![no_core] -#![crate_type = "lib"] - -#[macro_use] -extern crate a; - -bar!(); diff --git a/tests/run-make/use-extern-for-plugins/foo.rs b/tests/run-make/use-extern-for-plugins/foo.rs deleted file mode 100644 index dffdc079887..00000000000 --- a/tests/run-make/use-extern-for-plugins/foo.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![no_std] -#![crate_type = "lib"] -#![crate_name = "a"] - -#[macro_export] -macro_rules! foo { - () => () -} diff --git a/tests/rustdoc-gui/impl_on_foreign_order.goml b/tests/rustdoc-gui/impl_on_foreign_order.goml new file mode 100644 index 00000000000..a6f5343beb2 --- /dev/null +++ b/tests/rustdoc-gui/impl_on_foreign_order.goml @@ -0,0 +1,6 @@ +// This test ensures that the "implementations on foreign types" of a trait are correctly sorted. +go-to: "file://" + |DOC_PATH| + "/test_docs/foreign_impl_order/trait.Foo.html" +assert-text: ("details:nth-of-type(1) h3", "impl Foo<1> for [u8; 1]") +assert-text: ("details:nth-of-type(2) h3", "impl Foo<2> for [u8; 2]") +assert-text: ("details:nth-of-type(3) h3", "impl Foo<3> for [u8; 3]") +assert-text: ("details:nth-of-type(4) h3", "impl Foo<4> for [u8; 4]") diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml index 1c0c9e79e40..db1605ff220 100644 --- a/tests/rustdoc-gui/search-tab.goml +++ b/tests/rustdoc-gui/search-tab.goml @@ -79,7 +79,7 @@ call-function: ("check-colors", { set-window-size: (851, 600) // Check the size and count in tabs -assert-text: ("#search-tabs > button:nth-child(1) > .count", " (24) ") +assert-text: ("#search-tabs > button:nth-child(1) > .count", " (25) ") assert-text: ("#search-tabs > button:nth-child(2) > .count", " (5)  ") assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0)  ") store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth}) diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs index 138a1b302fd..c7d115bdb98 100644 --- a/tests/rustdoc-gui/src/test_docs/lib.rs +++ b/tests/rustdoc-gui/src/test_docs/lib.rs @@ -574,3 +574,22 @@ impl ZyxwvutTrait for ZyxwvutMethodDisambiguation { x } } + +pub mod foreign_impl_order { + pub trait Foo<const W: usize> { + fn f(&mut self, with: [u8; W]); + } + + impl Foo<4> for [u8; 4] { + fn f(&mut self, fg: [u8; 4]) {} + } + impl Foo<2> for [u8; 2] { + fn f(&mut self, fg: [u8; 2]) {} + } + impl Foo<1> for [u8; 1] { + fn f(&mut self, fg: [u8; 1]) {} + } + impl Foo<3> for [u8; 3] { + fn f(&mut self, fg: [u8; 3]) {} + } +} diff --git a/tests/rustdoc-ui/issues/issue-83883-describe-lints.stdout b/tests/rustdoc-ui/issues/issue-83883-describe-lints.stdout index bbf66a31583..6021bce6939 100644 --- a/tests/rustdoc-ui/issues/issue-83883-describe-lints.stdout +++ b/tests/rustdoc-ui/issues/issue-83883-describe-lints.stdout @@ -14,11 +14,11 @@ Lint groups provided by rustc: $NAMES $SUB_LINTS -Lint checks provided by plugins loaded by this crate: +Lint checks loaded by this crate: $NAMES $LEVELS $MEANINGS -Lint groups provided by plugins loaded by this crate: +Lint groups loaded by this crate: $NAMES $SUB_LINTS diff --git a/tests/ui-fulldeps/plugin/auxiliary/empty-plugin.rs b/tests/ui-fulldeps/plugin/auxiliary/empty-plugin.rs deleted file mode 100644 index c24cdc97aa5..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/empty-plugin.rs +++ /dev/null @@ -1,9 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_driver; -use rustc_driver::plugin::Registry; - -#[no_mangle] -fn __rustc_plugin_registrar(_: &mut Registry) {} diff --git a/tests/ui-fulldeps/plugin/auxiliary/issue-40001-plugin.rs b/tests/ui-fulldeps/plugin/auxiliary/issue-40001-plugin.rs deleted file mode 100644 index 3f6caecaa5a..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/issue-40001-plugin.rs +++ /dev/null @@ -1,61 +0,0 @@ -#![feature(plugin, rustc_private)] -#![crate_type = "dylib"] - -extern crate rustc_ast_pretty; -extern crate rustc_driver; -extern crate rustc_hir; -extern crate rustc_lint; -#[macro_use] -extern crate rustc_session; -extern crate rustc_ast; -extern crate rustc_span; - -use rustc_ast_pretty::pprust; -use rustc_driver::plugin::Registry; -use rustc_hir as hir; -use rustc_hir::intravisit; -use rustc_hir::Node; -use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_span::def_id::LocalDefId; -use rustc_span::source_map; - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[&MISSING_ALLOWED_ATTR]); - reg.lint_store.register_late_pass(|_| Box::new(MissingAllowedAttrPass)); -} - -declare_lint! { - MISSING_ALLOWED_ATTR, - Deny, - "Checks for missing `allowed_attr` attribute" -} - -declare_lint_pass!(MissingAllowedAttrPass => [MISSING_ALLOWED_ATTR]); - -impl<'tcx> LateLintPass<'tcx> for MissingAllowedAttrPass { - fn check_fn( - &mut self, - cx: &LateContext<'tcx>, - _: intravisit::FnKind<'tcx>, - _: &'tcx hir::FnDecl, - _: &'tcx hir::Body, - span: source_map::Span, - def_id: LocalDefId, - ) { - let id = cx.tcx.hir().local_def_id_to_hir_id(def_id); - let item = match cx.tcx.hir().get(id) { - Node::Item(item) => item, - _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id).def_id), - }; - - let allowed = |attr| pprust::attribute_to_string(attr).contains("allowed_attr"); - if !cx.tcx.hir().attrs(item.hir_id()).iter().any(allowed) { - cx.lint( - MISSING_ALLOWED_ATTR, - "Missing 'allowed_attr' attribute", - |lint| lint.set_span(span) - ); - } - } -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lint-for-crate.rs b/tests/ui-fulldeps/plugin/auxiliary/lint-for-crate.rs deleted file mode 100644 index 6304c07d2c7..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lint-for-crate.rs +++ /dev/null @@ -1,43 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_driver; -extern crate rustc_hir; -extern crate rustc_lint; -#[macro_use] -extern crate rustc_session; -extern crate rustc_ast; -extern crate rustc_span; - -use rustc_ast::attr; -use rustc_driver::plugin::Registry; -use rustc_lint::{LateContext, LateLintPass, LintContext}; -use rustc_span::def_id::CRATE_DEF_ID; -use rustc_span::symbol::Symbol; - -declare_lint! { - CRATE_NOT_OKAY, - Warn, - "crate not marked with #![crate_okay]" -} - -declare_lint_pass!(Pass => [CRATE_NOT_OKAY]); - -impl<'tcx> LateLintPass<'tcx> for Pass { - fn check_crate(&mut self, cx: &LateContext) { - let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID); - let span = cx.tcx.def_span(CRATE_DEF_ID); - if !attr::contains_name(attrs, Symbol::intern("crate_okay")) { - cx.lint(CRATE_NOT_OKAY, "crate is not marked with #![crate_okay]", |lint| { - lint.set_span(span) - }); - } - } -} - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[&CRATE_NOT_OKAY]); - reg.lint_store.register_late_pass(|_| Box::new(Pass)); -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lint-group-plugin-test.rs b/tests/ui-fulldeps/plugin/auxiliary/lint-group-plugin-test.rs deleted file mode 100644 index 150f0c6b9a2..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lint-group-plugin-test.rs +++ /dev/null @@ -1,43 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -// Load rustc as a plugin to get macros. -extern crate rustc_driver; -extern crate rustc_hir; -extern crate rustc_lint; -#[macro_use] -extern crate rustc_session; - -use rustc_driver::plugin::Registry; -use rustc_lint::{LateContext, LateLintPass, LintContext, LintId}; - -declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); - -declare_lint!(PLEASE_LINT, Warn, "Warn about items named 'pleaselintme'"); - -declare_lint_pass!(Pass => [TEST_LINT, PLEASE_LINT]); - -impl<'tcx> LateLintPass<'tcx> for Pass { - fn check_item(&mut self, cx: &LateContext, it: &rustc_hir::Item) { - match it.ident.as_str() { - "lintme" => cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)), - "pleaselintme" => { - cx.lint(PLEASE_LINT, "item is named 'pleaselintme'", |lint| lint.set_span(it.span)) - } - _ => {} - } - } -} - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[&TEST_LINT, &PLEASE_LINT]); - reg.lint_store.register_late_pass(|_| Box::new(Pass)); - reg.lint_store.register_group( - true, - "lint_me", - None, - vec![LintId::of(&TEST_LINT), LintId::of(&PLEASE_LINT)], - ); -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lint-plugin-test.rs b/tests/ui-fulldeps/plugin/auxiliary/lint-plugin-test.rs deleted file mode 100644 index acc5fe76051..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lint-plugin-test.rs +++ /dev/null @@ -1,33 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_ast; - -// Load rustc as a plugin to get macros -extern crate rustc_driver; -extern crate rustc_lint; -#[macro_use] -extern crate rustc_session; - -use rustc_ast::ast; -use rustc_driver::plugin::Registry; -use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; - -declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); - -declare_lint_pass!(Pass => [TEST_LINT]); - -impl EarlyLintPass for Pass { - fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) { - if it.ident.name.as_str() == "lintme" { - cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)); - } - } -} - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[&TEST_LINT]); - reg.lint_store.register_early_pass(|| Box::new(Pass)); -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lint-tool-test.rs b/tests/ui-fulldeps/plugin/auxiliary/lint-tool-test.rs deleted file mode 100644 index 21de4aa7008..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lint-tool-test.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![feature(rustc_private)] - -extern crate rustc_ast; - -// Load rustc as a plugin to get macros -extern crate rustc_driver; -extern crate rustc_lint; -#[macro_use] -extern crate rustc_session; - -use rustc_ast as ast; -use rustc_driver::plugin::Registry; -use rustc_lint::{EarlyContext, EarlyLintPass, LintContext, LintId}; - -declare_tool_lint!(pub clippy::TEST_LINT, Warn, "Warn about stuff"); -declare_tool_lint!( - /// Some docs - pub clippy::TEST_GROUP, - Warn, "Warn about other stuff" -); - -declare_tool_lint!( - /// Some docs - pub rustc::TEST_RUSTC_TOOL_LINT, - Deny, - "Deny internal stuff" -); - -declare_lint_pass!(Pass => [TEST_LINT, TEST_GROUP, TEST_RUSTC_TOOL_LINT]); - -impl EarlyLintPass for Pass { - fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) { - if it.ident.name.as_str() == "lintme" { - cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)); - } - if it.ident.name.as_str() == "lintmetoo" { - cx.lint(TEST_GROUP, "item is named 'lintmetoo'", |lint| lint.set_span(it.span)); - } - } -} - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[&TEST_RUSTC_TOOL_LINT, &TEST_LINT, &TEST_GROUP]); - reg.lint_store.register_early_pass(|| Box::new(Pass)); - reg.lint_store.register_group( - true, - "clippy::group", - Some("clippy_group"), - vec![LintId::of(&TEST_LINT), LintId::of(&TEST_GROUP)], - ); -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-lib.rs b/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-lib.rs deleted file mode 100644 index 954a1e554da..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] - -pub fn foo() {} diff --git a/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-plugin.rs b/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-plugin.rs deleted file mode 100644 index 9b075c1a5b9..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/lto-syntax-extension-plugin.rs +++ /dev/null @@ -1,11 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_middle; -extern crate rustc_driver; - -use rustc_driver::plugin::Registry; - -#[no_mangle] -fn __rustc_plugin_registrar(_reg: &mut Registry) {} diff --git a/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-1.rs b/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-1.rs deleted file mode 100644 index fd6e9e20f03..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-1.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_type = "dylib"] -#![feature(rustc_private)] - -extern crate rustc_middle; -extern crate rustc_driver; - -use rustc_driver::plugin::Registry; - -#[no_mangle] -fn __rustc_plugin_registrar(_: &mut Registry) {} diff --git a/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-2.rs b/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-2.rs deleted file mode 100644 index fd6e9e20f03..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/multiple-plugins-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_type = "dylib"] -#![feature(rustc_private)] - -extern crate rustc_middle; -extern crate rustc_driver; - -use rustc_driver::plugin::Registry; - -#[no_mangle] -fn __rustc_plugin_registrar(_: &mut Registry) {} diff --git a/tests/ui-fulldeps/plugin/auxiliary/outlive-expansion-phase.rs b/tests/ui-fulldeps/plugin/auxiliary/outlive-expansion-phase.rs deleted file mode 100644 index e83dfe80463..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/outlive-expansion-phase.rs +++ /dev/null @@ -1,24 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_middle; -extern crate rustc_driver; - -use std::any::Any; -use std::cell::RefCell; -use rustc_driver::plugin::Registry; - -struct Foo { - foo: isize -} - -impl Drop for Foo { - fn drop(&mut self) {} -} - -#[no_mangle] -fn __rustc_plugin_registrar(_: &mut Registry) { - thread_local!(static FOO: RefCell<Option<Box<Any+Send>>> = RefCell::new(None)); - FOO.with(|s| *s.borrow_mut() = Some(Box::new(Foo { foo: 10 }) as Box<Any+Send>)); -} diff --git a/tests/ui-fulldeps/plugin/auxiliary/rlib-crate-test.rs b/tests/ui-fulldeps/plugin/auxiliary/rlib-crate-test.rs deleted file mode 100644 index 3ba73538ecf..00000000000 --- a/tests/ui-fulldeps/plugin/auxiliary/rlib-crate-test.rs +++ /dev/null @@ -1,12 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] -#![feature(rustc_private)] - -extern crate rustc_middle; -extern crate rustc_driver; - -use rustc_driver::plugin::Registry; - -#[no_mangle] -fn __rustc_plugin_registrar(_: &mut Registry) {} diff --git a/tests/ui-fulldeps/plugin/feature-gate-plugin.rs b/tests/ui-fulldeps/plugin/feature-gate-plugin.rs deleted file mode 100644 index 85eaf533643..00000000000 --- a/tests/ui-fulldeps/plugin/feature-gate-plugin.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:empty-plugin.rs -// ignore-stage1 - -#![plugin(empty_plugin)] -//~^ ERROR compiler plugins are deprecated -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui-fulldeps/plugin/feature-gate-plugin.stderr b/tests/ui-fulldeps/plugin/feature-gate-plugin.stderr deleted file mode 100644 index 5e40561c7f5..00000000000 --- a/tests/ui-fulldeps/plugin/feature-gate-plugin.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0658]: compiler plugins are deprecated - --> $DIR/feature-gate-plugin.rs:4:1 - | -LL | #![plugin(empty_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information - = help: add `#![feature(plugin)]` to the crate attributes to enable - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/feature-gate-plugin.rs:4:1 - | -LL | #![plugin(empty_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui-fulldeps/plugin/gated-plugin.rs b/tests/ui-fulldeps/plugin/gated-plugin.rs deleted file mode 100644 index 85eaf533643..00000000000 --- a/tests/ui-fulldeps/plugin/gated-plugin.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:empty-plugin.rs -// ignore-stage1 - -#![plugin(empty_plugin)] -//~^ ERROR compiler plugins are deprecated -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui-fulldeps/plugin/gated-plugin.stderr b/tests/ui-fulldeps/plugin/gated-plugin.stderr deleted file mode 100644 index f48f1eab60b..00000000000 --- a/tests/ui-fulldeps/plugin/gated-plugin.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0658]: compiler plugins are deprecated - --> $DIR/gated-plugin.rs:4:1 - | -LL | #![plugin(empty_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information - = help: add `#![feature(plugin)]` to the crate attributes to enable - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/gated-plugin.rs:4:1 - | -LL | #![plugin(empty_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui-fulldeps/plugin/issue-15778-fail.rs b/tests/ui-fulldeps/plugin/issue-15778-fail.rs deleted file mode 100644 index beecaadf955..00000000000 --- a/tests/ui-fulldeps/plugin/issue-15778-fail.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:lint-for-crate.rs -// ignore-stage1 -// compile-flags: -D crate-not-okay - -#![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay] -#![plugin(lint_for_crate)] -//~^ WARN use of deprecated attribute `plugin` - -pub fn main() { } diff --git a/tests/ui-fulldeps/plugin/issue-15778-fail.stderr b/tests/ui-fulldeps/plugin/issue-15778-fail.stderr deleted file mode 100644 index a37893e1203..00000000000 --- a/tests/ui-fulldeps/plugin/issue-15778-fail.stderr +++ /dev/null @@ -1,22 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-15778-fail.rs:6:1 - | -LL | #![plugin(lint_for_crate)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: crate is not marked with #![crate_okay] - --> $DIR/issue-15778-fail.rs:5:1 - | -LL | / #![feature(plugin)] -LL | | #![plugin(lint_for_crate)] -LL | | -LL | | -LL | | pub fn main() { } - | |_________________^ - | - = note: requested on the command line with `-D crate-not-okay` - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/issue-40001.rs b/tests/ui-fulldeps/plugin/issue-40001.rs deleted file mode 100644 index e14338fdbbf..00000000000 --- a/tests/ui-fulldeps/plugin/issue-40001.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass -// aux-build:issue-40001-plugin.rs -// ignore-stage1 - -#![feature(plugin, register_tool)] -#![plugin(issue_40001_plugin)] //~ WARNING compiler plugins are deprecated -#![register_tool(plugin)] - -#[plugin::allowed_attr] -fn main() {} diff --git a/tests/ui-fulldeps/plugin/issue-40001.stderr b/tests/ui-fulldeps/plugin/issue-40001.stderr deleted file mode 100644 index 73ec0692464..00000000000 --- a/tests/ui-fulldeps/plugin/issue-40001.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/issue-40001.rs:6:1 - | -LL | #![plugin(issue_40001_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.rs b/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.rs deleted file mode 100644 index 9f8a879608c..00000000000 --- a/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.rs +++ /dev/null @@ -1,17 +0,0 @@ -// aux-build:lint-group-plugin-test.rs -// ignore-stage1 -// compile-flags: -D lint-me - -#![feature(plugin)] - -#![plugin(lint_group_plugin_test)] -//~^ WARN use of deprecated attribute `plugin` - -fn lintme() { } //~ ERROR item is named 'lintme' - -fn pleaselintme() { } //~ ERROR item is named 'pleaselintme' - -pub fn main() { - lintme(); - pleaselintme(); -} diff --git a/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.stderr b/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.stderr deleted file mode 100644 index 6e17bbde021..00000000000 --- a/tests/ui-fulldeps/plugin/lint-group-plugin-deny-cmdline.stderr +++ /dev/null @@ -1,28 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-group-plugin-deny-cmdline.rs:7:1 - | -LL | #![plugin(lint_group_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: item is named 'lintme' - --> $DIR/lint-group-plugin-deny-cmdline.rs:10:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: `-D test-lint` implied by `-D lint-me` - = help: to override `-D lint-me` add `#[allow(test_lint)]` - -error: item is named 'pleaselintme' - --> $DIR/lint-group-plugin-deny-cmdline.rs:12:1 - | -LL | fn pleaselintme() { } - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `-D please-lint` implied by `-D lint-me` - = help: to override `-D lint-me` add `#[allow(please_lint)]` - -error: aborting due to 2 previous errors; 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/lint-group-plugin.rs b/tests/ui-fulldeps/plugin/lint-group-plugin.rs deleted file mode 100644 index 7b74be7a954..00000000000 --- a/tests/ui-fulldeps/plugin/lint-group-plugin.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass -// aux-build:lint-group-plugin-test.rs -// ignore-stage1 - -#![feature(plugin)] -#![plugin(lint_group_plugin_test)] //~ WARNING use of deprecated attribute -#![allow(dead_code)] - -fn lintme() { } //~ WARNING item is named 'lintme' -fn pleaselintme() { } //~ WARNING item is named 'pleaselintme' - -#[allow(lint_me)] -pub fn main() { - fn lintme() { } - - fn pleaselintme() { } -} diff --git a/tests/ui-fulldeps/plugin/lint-group-plugin.stderr b/tests/ui-fulldeps/plugin/lint-group-plugin.stderr deleted file mode 100644 index 6f429dad017..00000000000 --- a/tests/ui-fulldeps/plugin/lint-group-plugin.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-group-plugin.rs:6:1 - | -LL | #![plugin(lint_group_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: item is named 'lintme' - --> $DIR/lint-group-plugin.rs:9:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: `#[warn(test_lint)]` on by default - -warning: item is named 'pleaselintme' - --> $DIR/lint-group-plugin.rs:10:1 - | -LL | fn pleaselintme() { } - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(please_lint)]` on by default - -warning: 3 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.rs b/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.rs deleted file mode 100644 index 1cc16e2fd1c..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -// aux-build:lint-plugin-test.rs -// ignore-stage1 -// compile-flags: -A test-lint - -#![feature(plugin)] -#![plugin(lint_plugin_test)] //~ WARNING compiler plugins are deprecated - -fn lintme() { } - -pub fn main() { -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.stderr b/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.stderr deleted file mode 100644 index f06703a2784..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-allow.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin-cmdline-allow.rs:7:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.rs b/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.rs deleted file mode 100644 index 0bd95dfbd14..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.rs +++ /dev/null @@ -1,13 +0,0 @@ -// check-pass -// aux-build:lint-plugin-test.rs -// ignore-stage1 -// compile-flags: -Z crate-attr=plugin(lint_plugin_test) - -#![feature(plugin)] - -fn lintme() { } //~ WARNING item is named 'lintme' - -#[allow(test_lint)] -pub fn main() { - fn lintme() { } -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.stderr b/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.stderr deleted file mode 100644 index 82679c9e10a..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-cmdline-load.stderr +++ /dev/null @@ -1,18 +0,0 @@ -warning: item is named 'lintme' - --> $DIR/lint-plugin-cmdline-load.rs:8:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: `#[warn(test_lint)]` on by default - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> <crate attribute>:1:1 - | -LL | plugin(lint_plugin_test) - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 2 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.rs b/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.rs deleted file mode 100644 index 04230a8e883..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:lint-plugin-test.rs -// ignore-stage1 - -#![feature(plugin)] -#![plugin(lint_plugin_test)] -//~^ WARN use of deprecated attribute `plugin` -#![deny(test_lint)] - -fn lintme() { } //~ ERROR item is named 'lintme' - -pub fn main() { - lintme(); -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.stderr b/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.stderr deleted file mode 100644 index 5e8891bf1f1..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-deny-attr.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: item is named 'lintme' - --> $DIR/lint-plugin-deny-attr.rs:9:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/lint-plugin-deny-attr.rs:7:9 - | -LL | #![deny(test_lint)] - | ^^^^^^^^^ - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin-deny-attr.rs:5:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.rs b/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.rs deleted file mode 100644 index c460cfd5f94..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.rs +++ /dev/null @@ -1,13 +0,0 @@ -// aux-build:lint-plugin-test.rs -// ignore-stage1 -// compile-flags: -D test-lint - -#![feature(plugin)] -#![plugin(lint_plugin_test)] -//~^ WARN use of deprecated attribute `plugin` - -fn lintme() { } //~ ERROR item is named 'lintme' - -pub fn main() { - lintme(); -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.stderr b/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.stderr deleted file mode 100644 index d5d6b535214..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-deny-cmdline.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: item is named 'lintme' - --> $DIR/lint-plugin-deny-cmdline.rs:9:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: requested on the command line with `-D test-lint` - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin-deny-cmdline.rs:6:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.rs b/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.rs deleted file mode 100644 index cf31b3ec158..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.rs +++ /dev/null @@ -1,16 +0,0 @@ -// aux-build:lint-plugin-test.rs -// ignore-stage1 - -#![feature(plugin)] -#![plugin(lint_plugin_test)] -//~^ WARN use of deprecated attribute `plugin` -#![forbid(test_lint)] - -fn lintme() {} //~ ERROR item is named 'lintme' - -#[allow(test_lint)] -//~^ ERROR allow(test_lint) incompatible -//~| ERROR allow(test_lint) incompatible -pub fn main() { - lintme(); -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.stderr b/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.stderr deleted file mode 100644 index 66ea2e88f0c..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-forbid-attrs.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0453]: allow(test_lint) incompatible with previous forbid - --> $DIR/lint-plugin-forbid-attrs.rs:11:9 - | -LL | #![forbid(test_lint)] - | --------- `forbid` level set here -... -LL | #[allow(test_lint)] - | ^^^^^^^^^ overruled by previous forbid - -error: item is named 'lintme' - --> $DIR/lint-plugin-forbid-attrs.rs:9:1 - | -LL | fn lintme() {} - | ^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/lint-plugin-forbid-attrs.rs:7:11 - | -LL | #![forbid(test_lint)] - | ^^^^^^^^^ - -error[E0453]: allow(test_lint) incompatible with previous forbid - --> $DIR/lint-plugin-forbid-attrs.rs:11:9 - | -LL | #![forbid(test_lint)] - | --------- `forbid` level set here -... -LL | #[allow(test_lint)] - | ^^^^^^^^^ overruled by previous forbid - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin-forbid-attrs.rs:5:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to 3 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0453`. diff --git a/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.rs b/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.rs deleted file mode 100644 index b9d1aa85a69..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.rs +++ /dev/null @@ -1,15 +0,0 @@ -// aux-build:lint-plugin-test.rs -// ignore-stage1 -// compile-flags: -F test-lint - -#![feature(plugin)] -#![plugin(lint_plugin_test)] -//~^ WARN use of deprecated attribute `plugin` -fn lintme() { } //~ ERROR item is named 'lintme' - -#[allow(test_lint)] //~ ERROR allow(test_lint) incompatible - //~| ERROR allow(test_lint) incompatible - -pub fn main() { - lintme(); -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.stderr b/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.stderr deleted file mode 100644 index 9dbad702545..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin-forbid-cmdline.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0453]: allow(test_lint) incompatible with previous forbid - --> $DIR/lint-plugin-forbid-cmdline.rs:10:9 - | -LL | #[allow(test_lint)] - | ^^^^^^^^^ overruled by previous forbid - | - = note: `forbid` lint level was set on command line - -error: item is named 'lintme' - --> $DIR/lint-plugin-forbid-cmdline.rs:8:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: requested on the command line with `-F test-lint` - -error[E0453]: allow(test_lint) incompatible with previous forbid - --> $DIR/lint-plugin-forbid-cmdline.rs:10:9 - | -LL | #[allow(test_lint)] - | ^^^^^^^^^ overruled by previous forbid - | - = note: `forbid` lint level was set on command line - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin-forbid-cmdline.rs:6:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to 3 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0453`. diff --git a/tests/ui-fulldeps/plugin/lint-plugin.rs b/tests/ui-fulldeps/plugin/lint-plugin.rs deleted file mode 100644 index 66057eea6bc..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -// aux-build:lint-plugin-test.rs -// ignore-stage1 -#![feature(plugin)] -#![plugin(lint_plugin_test)] //~ WARNING use of deprecated attribute -#![allow(dead_code)] - -fn lintme() { } //~ WARNING item is named 'lintme' - -#[allow(test_lint)] -pub fn main() { - fn lintme() { } -} diff --git a/tests/ui-fulldeps/plugin/lint-plugin.stderr b/tests/ui-fulldeps/plugin/lint-plugin.stderr deleted file mode 100644 index dd5d3d72ecf..00000000000 --- a/tests/ui-fulldeps/plugin/lint-plugin.stderr +++ /dev/null @@ -1,18 +0,0 @@ -warning: item is named 'lintme' - --> $DIR/lint-plugin.rs:8:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | - = note: `#[warn(test_lint)]` on by default - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-plugin.rs:5:1 - | -LL | #![plugin(lint_plugin_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 2 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.rs b/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.rs deleted file mode 100644 index 83a8b3e1a7e..00000000000 --- a/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -// aux-build:lint-tool-test.rs -// ignore-stage1 -// compile-flags: -A test-lint - -#![feature(plugin)] -#![plugin(lint_tool_test)] //~ WARNING compiler plugins are deprecated - -fn lintme() {} -//~^ WARNING item is named 'lintme' [clippy::test_lint] - -pub fn main() {} diff --git a/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.stderr b/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.stderr deleted file mode 100644 index 4916b180a36..00000000000 --- a/tests/ui-fulldeps/plugin/lint-tool-cmdline-allow.stderr +++ /dev/null @@ -1,36 +0,0 @@ -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - | - = help: change it to clippy::test_lint - = note: requested on the command line with `-A test_lint` - = note: `#[warn(renamed_and_removed_lints)]` on by default - -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - | - = help: change it to clippy::test_lint - = note: requested on the command line with `-A test_lint` - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: item is named 'lintme' - --> $DIR/lint-tool-cmdline-allow.rs:9:1 - | -LL | fn lintme() {} - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(clippy::test_lint)]` on by default - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-tool-cmdline-allow.rs:7:1 - | -LL | #![plugin(lint_tool_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - | - = help: change it to clippy::test_lint - = note: requested on the command line with `-A test_lint` - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: 5 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/lint-tool-test.rs b/tests/ui-fulldeps/plugin/lint-tool-test.rs deleted file mode 100644 index f92bcd213b8..00000000000 --- a/tests/ui-fulldeps/plugin/lint-tool-test.rs +++ /dev/null @@ -1,36 +0,0 @@ -// aux-build:lint-tool-test.rs -// ignore-stage1 -// compile-flags: --cfg foo - -#![feature(plugin)] -#![plugin(lint_tool_test)] -//~^ WARN use of deprecated attribute `plugin` -#![allow(dead_code)] -#![cfg_attr(foo, warn(test_lint))] -//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future -//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future -//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future -#![deny(clippy_group)] -//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future -//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future -//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future - -fn lintme() { } //~ ERROR item is named 'lintme' - -#[allow(clippy::group)] -fn lintmetoo() {} - -#[allow(clippy::test_lint)] -pub fn main() { - fn lintme() { } - fn lintmetoo() { } //~ ERROR item is named 'lintmetoo' -} - -#[allow(test_group)] -//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future -//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future -//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future -#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist` -fn hello() { - fn lintmetoo() { } -} diff --git a/tests/ui-fulldeps/plugin/lint-tool-test.stderr b/tests/ui-fulldeps/plugin/lint-tool-test.stderr deleted file mode 100644 index d1f0714f042..00000000000 --- a/tests/ui-fulldeps/plugin/lint-tool-test.stderr +++ /dev/null @@ -1,107 +0,0 @@ -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:9:23 - | -LL | #![cfg_attr(foo, warn(test_lint))] - | ^^^^^^^^^ help: change it to: `clippy::test_lint` - | - = note: `#[warn(renamed_and_removed_lints)]` on by default - -warning: lint name `clippy_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:13:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` - -warning: lint name `test_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:29:9 - | -LL | #[allow(test_group)] - | ^^^^^^^^^^ help: change it to: `clippy::test_group` - -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:9:23 - | -LL | #![cfg_attr(foo, warn(test_lint))] - | ^^^^^^^^^ help: change it to: `clippy::test_lint` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: lint name `clippy_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:13:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: item is named 'lintme' - --> $DIR/lint-tool-test.rs:18:1 - | -LL | fn lintme() { } - | ^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/lint-tool-test.rs:13:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ - = note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]` - -error: item is named 'lintmetoo' - --> $DIR/lint-tool-test.rs:26:5 - | -LL | fn lintmetoo() { } - | ^^^^^^^^^^^^^^^^^^ - | - = note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]` - -warning: lint name `test_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:29:9 - | -LL | #[allow(test_group)] - | ^^^^^^^^^^ help: change it to: `clippy::test_group` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: unknown lint: `this_lint_does_not_exist` - --> $DIR/lint-tool-test.rs:33:8 - | -LL | #[deny(this_lint_does_not_exist)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unknown_lints)]` on by default - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lint-tool-test.rs:6:1 - | -LL | #![plugin(lint_tool_test)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: lint name `test_lint` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:9:23 - | -LL | #![cfg_attr(foo, warn(test_lint))] - | ^^^^^^^^^ help: change it to: `clippy::test_lint` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: lint name `clippy_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:13:9 - | -LL | #![deny(clippy_group)] - | ^^^^^^^^^^^^ help: change it to: `clippy::group` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -warning: lint name `test_group` is deprecated and may not have an effect in the future. - --> $DIR/lint-tool-test.rs:29:9 - | -LL | #[allow(test_group)] - | ^^^^^^^^^^ help: change it to: `clippy::test_group` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: aborting due to 2 previous errors; 11 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/lto-syntax-extension.rs b/tests/ui-fulldeps/plugin/lto-syntax-extension.rs deleted file mode 100644 index 5964e70f195..00000000000 --- a/tests/ui-fulldeps/plugin/lto-syntax-extension.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass -// aux-build:lto-syntax-extension-lib.rs -// aux-build:lto-syntax-extension-plugin.rs -// compile-flags:-C lto -// ignore-stage1 -// no-prefer-dynamic - -#![feature(plugin)] -#![plugin(lto_syntax_extension_plugin)] //~ WARNING compiler plugins are deprecated - -extern crate lto_syntax_extension_lib; - -fn main() { - lto_syntax_extension_lib::foo(); -} diff --git a/tests/ui-fulldeps/plugin/lto-syntax-extension.stderr b/tests/ui-fulldeps/plugin/lto-syntax-extension.stderr deleted file mode 100644 index 555493f3230..00000000000 --- a/tests/ui-fulldeps/plugin/lto-syntax-extension.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/lto-syntax-extension.rs:9:1 - | -LL | #![plugin(lto_syntax_extension_plugin)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/macro-crate-rlib.rs b/tests/ui-fulldeps/plugin/macro-crate-rlib.rs deleted file mode 100644 index 38bd340539b..00000000000 --- a/tests/ui-fulldeps/plugin/macro-crate-rlib.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:rlib-crate-test.rs -// ignore-stage1 -// ignore-cross-compile gives a different error message - -#![feature(plugin)] -#![plugin(rlib_crate_test)] -//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib - -fn main() {} diff --git a/tests/ui-fulldeps/plugin/macro-crate-rlib.stderr b/tests/ui-fulldeps/plugin/macro-crate-rlib.stderr deleted file mode 100644 index 0651cee56f7..00000000000 --- a/tests/ui-fulldeps/plugin/macro-crate-rlib.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format - --> $DIR/macro-crate-rlib.rs:6:11 - | -LL | #![plugin(rlib_crate_test)] - | ^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0457`. diff --git a/tests/ui-fulldeps/plugin/multiple-plugins.rs b/tests/ui-fulldeps/plugin/multiple-plugins.rs deleted file mode 100644 index 9af3ebd570c..00000000000 --- a/tests/ui-fulldeps/plugin/multiple-plugins.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -// aux-build:multiple-plugins-1.rs -// aux-build:multiple-plugins-2.rs -// ignore-stage1 - -// Check that the plugin registrar of multiple plugins doesn't conflict - -#![feature(plugin)] -#![plugin(multiple_plugins_1)] //~ WARN use of deprecated attribute `plugin` -#![plugin(multiple_plugins_2)] //~ WARN use of deprecated attribute `plugin` - -fn main() {} diff --git a/tests/ui-fulldeps/plugin/multiple-plugins.stderr b/tests/ui-fulldeps/plugin/multiple-plugins.stderr deleted file mode 100644 index 878ffabfc7f..00000000000 --- a/tests/ui-fulldeps/plugin/multiple-plugins.stderr +++ /dev/null @@ -1,16 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/multiple-plugins.rs:9:1 - | -LL | #![plugin(multiple_plugins_1)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/multiple-plugins.rs:10:1 - | -LL | #![plugin(multiple_plugins_2)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - -warning: 2 warnings emitted - diff --git a/tests/ui-fulldeps/plugin/outlive-expansion-phase.rs b/tests/ui-fulldeps/plugin/outlive-expansion-phase.rs deleted file mode 100644 index fb22888d98a..00000000000 --- a/tests/ui-fulldeps/plugin/outlive-expansion-phase.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass -// aux-build:outlive-expansion-phase.rs -// ignore-stage1 - -#![feature(plugin)] -#![plugin(outlive_expansion_phase)] //~ WARNING compiler plugins are deprecated - -pub fn main() {} diff --git a/tests/ui-fulldeps/plugin/outlive-expansion-phase.stderr b/tests/ui-fulldeps/plugin/outlive-expansion-phase.stderr deleted file mode 100644 index e40a08ae73b..00000000000 --- a/tests/ui-fulldeps/plugin/outlive-expansion-phase.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/outlive-expansion-phase.rs:6:1 - | -LL | #![plugin(outlive_expansion_phase)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui-fulldeps/plugin/plugin-args.rs b/tests/ui-fulldeps/plugin/plugin-args.rs deleted file mode 100644 index 488f2b775bf..00000000000 --- a/tests/ui-fulldeps/plugin/plugin-args.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:empty-plugin.rs -// ignore-stage1 - -#![feature(plugin)] -#![plugin(empty_plugin(args))] -//~^ ERROR malformed `plugin` attribute -//~| WARNING compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui-fulldeps/plugin/plugin-args.stderr b/tests/ui-fulldeps/plugin/plugin-args.stderr deleted file mode 100644 index 177f33005c8..00000000000 --- a/tests/ui-fulldeps/plugin/plugin-args.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0498]: malformed `plugin` attribute - --> $DIR/plugin-args.rs:5:11 - | -LL | #![plugin(empty_plugin(args))] - | ^^^^^^^^^^^^^^^^^^ malformed attribute - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/plugin-args.rs:5:1 - | -LL | #![plugin(empty_plugin(args))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0498`. diff --git a/tests/ui-fulldeps/plugin/plugin-as-extern-crate.rs b/tests/ui-fulldeps/plugin/plugin-as-extern-crate.rs deleted file mode 100644 index 4d26e08d81e..00000000000 --- a/tests/ui-fulldeps/plugin/plugin-as-extern-crate.rs +++ /dev/null @@ -1,10 +0,0 @@ -// check-pass -// aux-build:empty-plugin.rs -// ignore-cross-compile -// -// empty_plugin will not compile on a cross-compiled target because -// librustc_ast is not compiled for it. - -extern crate empty_plugin; // OK, plugin crates are still crates - -fn main() {} diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs index 541be7ebbc0..3d6cff00a6d 100644 --- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs +++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs @@ -38,9 +38,9 @@ use rustc_ast::*; use rustc_ast_pretty::pprust; use rustc_parse::new_parser_from_source_str; use rustc_session::parse::ParseSess; -use rustc_span::source_map::FilePathMapping; -use rustc_span::source_map::{FileName, Spanned, DUMMY_SP}; +use rustc_span::source_map::{FilePathMapping, Spanned}; use rustc_span::symbol::Ident; +use rustc_span::{FileName, DUMMY_SP}; use thin_vec::{thin_vec, ThinVec}; fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> { diff --git a/tests/ui/borrowck/alias-liveness/escaping-bounds-2.rs b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.rs new file mode 100644 index 00000000000..05884f6741c --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.rs @@ -0,0 +1,14 @@ +trait Trait { + type Gat<'a: 'b, 'b: 'c, 'c>: 'c; +} + +fn get_func<'a, T: Trait>(_: &'a str) -> fn(T::Gat<'a, '_, 'static>) { + loop {} +} + +fn test<T: Trait>() { + let func = get_func::<T>(&String::new()); //~ ERROR temporary value dropped + drop(func); +} + +fn main() {} diff --git a/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr new file mode 100644 index 00000000000..7fd0cb9bb02 --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/escaping-bounds-2.stderr @@ -0,0 +1,19 @@ +error[E0716]: temporary value dropped while borrowed + --> $DIR/escaping-bounds-2.rs:10:31 + | +LL | let func = get_func::<T>(&String::new()); + | ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement + | | + | creates a temporary value which is freed while still in use +LL | drop(func); + | ---- borrow later used here + | +help: consider using a `let` binding to create a longer lived value + | +LL ~ let binding = String::new(); +LL ~ let func = get_func::<T>(&binding); + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0716`. diff --git a/tests/ui/borrowck/alias-liveness/escaping-bounds.rs b/tests/ui/borrowck/alias-liveness/escaping-bounds.rs new file mode 100644 index 00000000000..3ccdc78e60a --- /dev/null +++ b/tests/ui/borrowck/alias-liveness/escaping-bounds.rs @@ -0,0 +1,22 @@ +// check-pass + +// Ensure that we don't ICE when an alias that has escaping bound vars is +// required to be live. This is because the code that allows us to deduce an +// appropriate outlives bound for a given alias type (in this test, a +// projection) does not handle aliases with escaping bound vars. +// See <https://github.com/rust-lang/rust/issues/117455>. + +trait Foo { + type Assoc<'a, 'b>: 'static; +} + +struct MentionsLifetimeAndType<'a, T>(&'a (), T); + +fn foo<'a, 'b, T: Foo>(_: <T as Foo>::Assoc<'a, 'b>) {} + +fn test<'b, T: Foo>() { + let y: MentionsLifetimeAndType<'_, for<'a> fn(<T as Foo>::Assoc<'a, 'b>)> = + MentionsLifetimeAndType(&(), foo); +} + +fn main() {} diff --git a/tests/ui/bounds-lifetime.rs b/tests/ui/bounds-lifetime.rs index 31aa4011b91..e3e635a4e84 100644 --- a/tests/ui/bounds-lifetime.rs +++ b/tests/ui/bounds-lifetime.rs @@ -2,6 +2,6 @@ type A = for<'b, 'a: 'b> fn(); //~ ERROR lifetime bounds cannot be used in this type B = for<'b, 'a: 'b,> fn(); //~ ERROR lifetime bounds cannot be used in this context type C = for<'b, 'a: 'b +> fn(); //~ ERROR lifetime bounds cannot be used in this context type D = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context -type E = dyn for<T> Fn(); //~ ERROR only lifetime parameters can be used in this context +type E = dyn for<T, U> Fn(); //~ ERROR only lifetime parameters can be used in this context fn main() {} diff --git a/tests/ui/bounds-lifetime.stderr b/tests/ui/bounds-lifetime.stderr index f0bfe784ccc..bbae835d875 100644 --- a/tests/ui/bounds-lifetime.stderr +++ b/tests/ui/bounds-lifetime.stderr @@ -28,8 +28,8 @@ LL | type D = for<'a, T> fn(); error[E0658]: only lifetime parameters can be used in this context --> $DIR/bounds-lifetime.rs:5:18 | -LL | type E = dyn for<T> Fn(); - | ^ +LL | type E = dyn for<T, U> 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 diff --git a/tests/ui/closures/closure-expected.rs b/tests/ui/closures/closure-expected.rs index 68cac3dd85e..d730bcd1faf 100644 --- a/tests/ui/closures/closure-expected.rs +++ b/tests/ui/closures/closure-expected.rs @@ -1,5 +1,5 @@ fn main() { let x = Some(1); let y = x.or_else(4); - //~^ ERROR expected a `FnOnce<()>` closure, found `{integer}` + //~^ ERROR expected a `FnOnce()` closure, found `{integer}` } diff --git a/tests/ui/closures/closure-expected.stderr b/tests/ui/closures/closure-expected.stderr index 87a5d67a420..565038f5144 100644 --- a/tests/ui/closures/closure-expected.stderr +++ b/tests/ui/closures/closure-expected.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnOnce<()>` closure, found `{integer}` +error[E0277]: expected a `FnOnce()` closure, found `{integer}` --> $DIR/closure-expected.rs:3:23 | LL | let y = x.or_else(4); - | ------- ^ expected an `FnOnce<()>` closure, found `{integer}` + | ------- ^ expected an `FnOnce()` closure, found `{integer}` | | | required by a bound introduced by this call | diff --git a/tests/ui/closures/coerce-unsafe-to-closure.stderr b/tests/ui/closures/coerce-unsafe-to-closure.stderr index 449cd0b3177..bd4ab13a205 100644 --- a/tests/ui/closures/coerce-unsafe-to-closure.stderr +++ b/tests/ui/closures/coerce-unsafe-to-closure.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` +error[E0277]: expected a `FnOnce(&str)` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` --> $DIR/coerce-unsafe-to-closure.rs:2:44 | LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); diff --git a/tests/ui/coroutine/borrowing.stderr b/tests/ui/coroutine/borrowing.stderr index 192ffaaa26b..acd4cdafdfd 100644 --- a/tests/ui/coroutine/borrowing.stderr +++ b/tests/ui/coroutine/borrowing.stderr @@ -1,24 +1,16 @@ error[E0597]: `a` does not live long enough --> $DIR/borrowing.rs:9:33 | +LL | let _b = { + | -- borrow later stored here +LL | let a = 3; LL | Pin::new(&mut || yield &a).resume(()) - | ----------^ - | | | - | | borrowed value does not live long enough + | -- ^ borrowed value does not live long enough + | | | value captured here by coroutine - | a temporary with access to the borrow is created here ... LL | LL | }; - | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for coroutine - | | - | `a` dropped here while still borrowed - | - = note: the temporary is part of an expression at the end of a block; - consider forcing this temporary to be dropped sooner, before the block's local variables are dropped -help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block - | -LL | let x = Pin::new(&mut || yield &a).resume(()); x - | +++++++ +++ + | - `a` dropped here while still borrowed error[E0597]: `a` does not live long enough --> $DIR/borrowing.rs:16:20 diff --git a/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.rs b/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.rs index feaaa71ea9c..ad39b71b0eb 100644 --- a/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.rs +++ b/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.rs @@ -1,4 +1,5 @@ // edition:2021 +// check-pass #![feature(coroutines)] fn main() { @@ -6,6 +7,5 @@ fn main() { || { let _c = || yield *&mut *x; || _ = &mut *x; - //~^ cannot borrow `*x` as mutable more than once at a time }; } diff --git a/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.stderr b/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.stderr deleted file mode 100644 index 77da6c4cdc9..00000000000 --- a/tests/ui/coroutine/issue-110929-coroutine-conflict-error-ice.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0499]: cannot borrow `*x` as mutable more than once at a time - --> $DIR/issue-110929-coroutine-conflict-error-ice.rs:8:9 - | -LL | let _c = || yield *&mut *x; - | -- -- first borrow occurs due to use of `*x` in coroutine - | | - | first mutable borrow occurs here -LL | || _ = &mut *x; - | ^^ -- second borrow occurs due to use of `*x` in closure - | | - | second mutable borrow occurs here -LL | -LL | }; - | - first borrow might be used here, when `_c` is dropped and runs the destructor for coroutine - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0499`. diff --git a/tests/ui/coroutine/retain-resume-ref.stderr b/tests/ui/coroutine/retain-resume-ref.stderr index 983443bbfeb..e33310d12d9 100644 --- a/tests/ui/coroutine/retain-resume-ref.stderr +++ b/tests/ui/coroutine/retain-resume-ref.stderr @@ -4,10 +4,9 @@ error[E0499]: cannot borrow `thing` as mutable more than once at a time LL | gen.as_mut().resume(&mut thing); | ---------- first mutable borrow occurs here LL | gen.as_mut().resume(&mut thing); - | ^^^^^^^^^^ second mutable borrow occurs here -LL | -LL | } - | - first borrow might be used here, when `gen` is dropped and runs the destructor for coroutine + | ------ ^^^^^^^^^^ second mutable borrow occurs here + | | + | first borrow later used by call error: aborting due to previous error diff --git a/tests/ui/dropck/coroutine-liveness-1.rs b/tests/ui/dropck/coroutine-liveness-1.rs new file mode 100644 index 00000000000..aea4d15ad90 --- /dev/null +++ b/tests/ui/dropck/coroutine-liveness-1.rs @@ -0,0 +1,18 @@ +// check-pass +// edition: 2021 + +// regression test for #116242. +use std::future; + +fn main() { + let mut recv = future::ready(()); + let _combined_fut = async { + let _ = || read(&mut recv); + }; + + drop(recv); +} + +fn read<F: future::Future>(_: &mut F) -> F::Output { + todo!() +} diff --git a/tests/ui/dropck/coroutine-liveness-2.rs b/tests/ui/dropck/coroutine-liveness-2.rs new file mode 100644 index 00000000000..416a073c6b9 --- /dev/null +++ b/tests/ui/dropck/coroutine-liveness-2.rs @@ -0,0 +1,23 @@ +// check-pass +// edition: 2021 + +// regression test found while working on #117134. +use std::future; + +fn main() { + let mut recv = future::ready(()); + let _combined_fut = async { + let _ = || read(&mut recv); + }; + + let _uwu = (String::new(), _combined_fut); + // Dropping a coroutine as part of a more complex + // types should not add unnecessary liveness + // constraints. + + drop(recv); +} + +fn read<F: future::Future>(_: &mut F) -> F::Output { + todo!() +} diff --git a/tests/ui/error-codes/E0463.rs b/tests/ui/error-codes/E0463.rs deleted file mode 100644 index 683565281cf..00000000000 --- a/tests/ui/error-codes/E0463.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![feature(plugin)] -#![plugin(cookie_monster)] -//~^ ERROR E0463 -extern crate cake_is_a_lie; - -fn main() { -} diff --git a/tests/ui/error-codes/E0463.stderr b/tests/ui/error-codes/E0463.stderr deleted file mode 100644 index 1aa66e1ec88..00000000000 --- a/tests/ui/error-codes/E0463.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0463]: can't find crate for `cookie_monster` - --> $DIR/E0463.rs:2:11 - | -LL | #![plugin(cookie_monster)] - | ^^^^^^^^^^^^^^ can't find crate - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0463`. diff --git a/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.rs b/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.rs index 9c685590b8b..5e64fd5d2af 100644 --- a/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.rs +++ b/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.rs @@ -1,6 +1,6 @@ fn main() { let number = 2; - Some(true).filter({ //~ ERROR expected a `FnOnce<(&bool,)>` closure, found `bool` + Some(true).filter({ //~ ERROR expected a `FnOnce(&bool)` closure, found `bool` if number % 2 == 0 { number == 0 } else { diff --git a/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.stderr b/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.stderr index b72360562f2..f70b3211743 100644 --- a/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.stderr +++ b/tests/ui/expr/malformed_closure/block_instead_of_closure_in_arg.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnOnce<(&bool,)>` closure, found `bool` +error[E0277]: expected a `FnOnce(&bool)` closure, found `bool` --> $DIR/block_instead_of_closure_in_arg.rs:3:23 | LL | Some(true).filter({ @@ -12,7 +12,7 @@ LL | || number != 0 LL | || } | ||_________- this tail expression is of type `bool` LL | | }); - | |______^ expected an `FnOnce<(&bool,)>` closure, found `bool` + | |______^ expected an `FnOnce(&bool)` closure, found `bool` | = help: the trait `for<'a> FnOnce<(&'a bool,)>` is not implemented for `bool` note: required by a bound in `Option::<T>::filter` diff --git a/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.rs b/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.rs index 982b9fd00f6..bb2e9c0a63c 100644 --- a/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.rs +++ b/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.rs @@ -1,6 +1,6 @@ const x: usize =42; fn main() { - let p = Some(45).and_then({|x| //~ ERROR expected a `FnOnce<({integer},)>` closure, found `Option<usize>` + let p = Some(45).and_then({|x| //~ ERROR expected a `FnOnce({integer})` closure, found `Option<usize>` 1 + 1; Some(x * 2) }); diff --git a/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.stderr b/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.stderr index 32d34430b7c..e44ec5ca93c 100644 --- a/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.stderr +++ b/tests/ui/expr/malformed_closure/ruby_style_closure_successful_parse.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<usize>` +error[E0277]: expected a `FnOnce({integer})` closure, found `Option<usize>` --> $DIR/ruby_style_closure_successful_parse.rs:3:31 | LL | let p = Some(45).and_then({|x| @@ -9,7 +9,7 @@ LL | | 1 + 1; LL | | Some(x * 2) | | ----------- this tail expression is of type `Option<usize>` LL | | }); - | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<usize>` + | |_____^ expected an `FnOnce({integer})` closure, found `Option<usize>` | = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<usize>` note: required by a bound in `Option::<T>::and_then` diff --git a/tests/ui/extern/extern-wrong-value-type.rs b/tests/ui/extern/extern-wrong-value-type.rs index 337865ec18d..56c6cf1dfab 100644 --- a/tests/ui/extern/extern-wrong-value-type.rs +++ b/tests/ui/extern/extern-wrong-value-type.rs @@ -7,5 +7,5 @@ fn main() { // extern functions are extern "C" fn let _x: extern "C" fn() = f; // OK is_fn(f); - //~^ ERROR expected a `Fn<()>` closure, found `extern "C" fn() {f}` + //~^ ERROR expected a `Fn()` closure, found `extern "C" fn() {f}` } diff --git a/tests/ui/extern/extern-wrong-value-type.stderr b/tests/ui/extern/extern-wrong-value-type.stderr index ff2934a2ba8..463cee83169 100644 --- a/tests/ui/extern/extern-wrong-value-type.stderr +++ b/tests/ui/extern/extern-wrong-value-type.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() {f}` +error[E0277]: expected a `Fn()` closure, found `extern "C" fn() {f}` --> $DIR/extern-wrong-value-type.rs:9:11 | LL | is_fn(f); - | ----- ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}` + | ----- ^ expected an `Fn()` closure, found `extern "C" fn() {f}` | | | required by a bound introduced by this call | diff --git a/tests/ui/fn/fn-trait-formatting.rs b/tests/ui/fn/fn-trait-formatting.rs index 636ac7107e6..61a8791ab1f 100644 --- a/tests/ui/fn/fn-trait-formatting.rs +++ b/tests/ui/fn/fn-trait-formatting.rs @@ -17,5 +17,5 @@ fn main() { //~| found struct `Box<dyn FnMut() -> isize>` needs_fn(1); - //~^ ERROR expected a `Fn<(isize,)>` closure, found `{integer}` + //~^ ERROR expected a `Fn(isize)` closure, found `{integer}` } diff --git a/tests/ui/fn/fn-trait-formatting.stderr b/tests/ui/fn/fn-trait-formatting.stderr index 45d543bda53..c5e2f41691f 100644 --- a/tests/ui/fn/fn-trait-formatting.stderr +++ b/tests/ui/fn/fn-trait-formatting.stderr @@ -39,11 +39,11 @@ LL | let _: () = Box::new(|| -> isize { unimplemented!() }) as Box<dyn FnMut = note: expected unit type `()` found struct `Box<dyn FnMut() -> isize>` -error[E0277]: expected a `Fn<(isize,)>` closure, found `{integer}` +error[E0277]: expected a `Fn(isize)` closure, found `{integer}` --> $DIR/fn-trait-formatting.rs:19:14 | LL | needs_fn(1); - | -------- ^ expected an `Fn<(isize,)>` closure, found `{integer}` + | -------- ^ expected an `Fn(isize)` closure, found `{integer}` | | | required by a bound introduced by this call | diff --git a/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs b/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs new file mode 100644 index 00000000000..7b168707239 --- /dev/null +++ b/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs @@ -0,0 +1,18 @@ +// check-pass + +#![feature(associated_type_defaults)] + +trait Foo { + type Bar<T>: Baz<Self> = i32; + // We should be able to prove that `i32: Baz<Self>` because of + // the impl below, which requires that `Self::Bar<()>: Eq<i32>` + // which is true, because we assume `for<T> Self::Bar<T> = i32`. +} + +trait Baz<T: ?Sized> {} +impl<T: Foo + ?Sized> Baz<T> for i32 where T::Bar<()>: Eq<i32> {} + +trait Eq<T> {} +impl<T> Eq<T> for T {} + +fn main() {} diff --git a/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs b/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs index f5502adee42..c444ee9e1cd 100644 --- a/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs +++ b/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs @@ -10,7 +10,7 @@ trait Fun { impl<T> Fun for T { type F<'a> = Self; - //~^ ERROR expected a `Fn<()>` closure, found `T` + //~^ ERROR expected a `Fn()` closure, found `T` } fn main() { diff --git a/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr b/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr index 07452137b5b..2376bda8190 100644 --- a/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr +++ b/tests/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `T` +error[E0277]: expected a `Fn()` closure, found `T` --> $DIR/issue-68642-broken-llvm-ir.rs:12:18 | LL | type F<'a> = Self; - | ^^^^ expected an `Fn<()>` closure, found `T` + | ^^^^ expected an `Fn()` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` diff --git a/tests/ui/generic-associated-types/issue-68643-broken-mir.rs b/tests/ui/generic-associated-types/issue-68643-broken-mir.rs index 6050a8bf561..39db51c0e2a 100644 --- a/tests/ui/generic-associated-types/issue-68643-broken-mir.rs +++ b/tests/ui/generic-associated-types/issue-68643-broken-mir.rs @@ -10,7 +10,7 @@ trait Fun { impl<T> Fun for T { type F<'a> = Self; - //~^ ERROR expected a `Fn<()>` closure, found `T` + //~^ ERROR expected a `Fn()` closure, found `T` } pub fn main() { diff --git a/tests/ui/generic-associated-types/issue-68643-broken-mir.stderr b/tests/ui/generic-associated-types/issue-68643-broken-mir.stderr index 31ded5dab95..2429531e4e5 100644 --- a/tests/ui/generic-associated-types/issue-68643-broken-mir.stderr +++ b/tests/ui/generic-associated-types/issue-68643-broken-mir.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `T` +error[E0277]: expected a `Fn()` closure, found `T` --> $DIR/issue-68643-broken-mir.rs:12:18 | LL | type F<'a> = Self; - | ^^^^ expected an `Fn<()>` closure, found `T` + | ^^^^ expected an `Fn()` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` diff --git a/tests/ui/generic-associated-types/issue-68644-codegen-selection.rs b/tests/ui/generic-associated-types/issue-68644-codegen-selection.rs index 898cfa1e744..e379bce07d3 100644 --- a/tests/ui/generic-associated-types/issue-68644-codegen-selection.rs +++ b/tests/ui/generic-associated-types/issue-68644-codegen-selection.rs @@ -10,7 +10,7 @@ trait Fun { impl<T> Fun for T { type F<'a> = Self; - //~^ ERROR expected a `Fn<()>` closure, found `T` + //~^ ERROR expected a `Fn()` closure, found `T` } fn main() { diff --git a/tests/ui/generic-associated-types/issue-68644-codegen-selection.stderr b/tests/ui/generic-associated-types/issue-68644-codegen-selection.stderr index e2f9930cc67..11221353a92 100644 --- a/tests/ui/generic-associated-types/issue-68644-codegen-selection.stderr +++ b/tests/ui/generic-associated-types/issue-68644-codegen-selection.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `T` +error[E0277]: expected a `Fn()` closure, found `T` --> $DIR/issue-68644-codegen-selection.rs:12:18 | LL | type F<'a> = Self; - | ^^^^ expected an `Fn<()>` closure, found `T` + | ^^^^ expected an `Fn()` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` diff --git a/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs b/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs index 60b065bfc31..e69a08b0a39 100644 --- a/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs +++ b/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs @@ -10,7 +10,7 @@ trait Fun { impl<T> Fun for T { type F<'a> = Self; - //~^ ERROR expected a `Fn<()>` closure, found `T` + //~^ ERROR expected a `Fn()` closure, found `T` } fn main() { diff --git a/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr b/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr index 0065368ad31..52300efc2d8 100644 --- a/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr +++ b/tests/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `T` +error[E0277]: expected a `Fn()` closure, found `T` --> $DIR/issue-68645-codegen-fulfillment.rs:12:18 | LL | type F<'a> = Self; - | ^^^^ expected an `Fn<()>` closure, found `T` + | ^^^^ expected an `Fn()` closure, found `T` | = note: wrap the `T` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Fun::F` diff --git a/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr b/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr index 9af6bc45c7a..8ab88c58075 100644 --- a/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr +++ b/tests/ui/higher-ranked/trait-bounds/fn-ptr.classic.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())` +error[E0277]: expected a `Fn(&'w ())` closure, found `fn(&'w ())` --> $DIR/fn-ptr.rs:12:5 | LL | ice(); - | ^^^ expected an `Fn<(&'w (),)>` closure, found `fn(&'w ())` + | ^^^ expected an `Fn(&'w ())` closure, found `fn(&'w ())` | = help: the trait `for<'w> Fn<(&'w (),)>` is not implemented for `fn(&'w ())` note: required by a bound in `ice` diff --git a/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs b/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs index 853160f9612..adb19c035bc 100644 --- a/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs +++ b/tests/ui/higher-ranked/trait-bounds/fn-ptr.rs @@ -10,5 +10,5 @@ where fn main() { ice(); - //[classic]~^ ERROR expected a `Fn<(&'w (),)>` closure, found `fn(&'w ())` + //[classic]~^ ERROR expected a `Fn(&'w ())` closure, found `fn(&'w ())` } diff --git a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr index 2cc2bb2bbc3..7b0743cc7c5 100644 --- a/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr +++ b/tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-62529-3.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F` +error[E0277]: expected a `Fn(<_ as ATC<'a>>::Type)` closure, found `F` --> $DIR/issue-62529-3.rs:25:14 | LL | call(f, ()); - | ---- ^ expected an `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F` + | ---- ^ expected an `Fn(<_ as ATC<'a>>::Type)` closure, found `F` | | | required by a bound introduced by this call | diff --git a/tests/ui/impl-trait/in-trait/nested-rpitit-bounds.rs b/tests/ui/impl-trait/in-trait/nested-rpitit-bounds.rs new file mode 100644 index 00000000000..b97fd7d1ffe --- /dev/null +++ b/tests/ui/impl-trait/in-trait/nested-rpitit-bounds.rs @@ -0,0 +1,11 @@ +// check-pass + +use std::ops::Deref; + +trait Foo { + fn foo() -> impl Deref<Target = impl Deref<Target = impl Sized>> { + &&() + } +} + +fn main() {} diff --git a/tests/ui/implied-bounds/issue-100690.rs b/tests/ui/implied-bounds/issue-100690.rs index 5599cd410ba..ea33c9f423b 100644 --- a/tests/ui/implied-bounds/issue-100690.rs +++ b/tests/ui/implied-bounds/issue-100690.rs @@ -35,8 +35,8 @@ impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandl F: FnOnce(&mut UIView<'a, T>) -> Result<(), io::Error> + Send + 'static, { real_dispatch(f) - //~^ ERROR expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` - //~| NOTE expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` + //~^ ERROR expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F` + //~| NOTE expected an `FnOnce(&mut UIView<'_, T>)` closure, found `F` //~| NOTE expected a closure with arguments //~| NOTE required by a bound introduced by this call } diff --git a/tests/ui/implied-bounds/issue-100690.stderr b/tests/ui/implied-bounds/issue-100690.stderr index dba0353377f..ac9f7ab2529 100644 --- a/tests/ui/implied-bounds/issue-100690.stderr +++ b/tests/ui/implied-bounds/issue-100690.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` +error[E0277]: expected a `FnOnce(&mut UIView<'_, T>)` closure, found `F` --> $DIR/issue-100690.rs:37:23 | LL | real_dispatch(f) - | ------------- ^ expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F` + | ------------- ^ expected an `FnOnce(&mut UIView<'_, T>)` closure, found `F` | | | required by a bound introduced by this call | diff --git a/tests/ui/intrinsics/const-eval-select-bad.rs b/tests/ui/intrinsics/const-eval-select-bad.rs index 991d1450aff..7e75de88d29 100644 --- a/tests/ui/intrinsics/const-eval-select-bad.rs +++ b/tests/ui/intrinsics/const-eval-select-bad.rs @@ -8,8 +8,8 @@ const fn not_fn_items() { //~^ ERROR this argument must be a function item //~| ERROR this argument must be a function item const_eval_select((), 42, 0xDEADBEEF); - //~^ ERROR expected a `FnOnce<()>` closure - //~| ERROR expected a `FnOnce<()>` closure + //~^ ERROR expected a `FnOnce()` closure + //~| ERROR expected a `FnOnce()` closure //~| ERROR this argument must be a function item //~| ERROR this argument must be a function item } diff --git a/tests/ui/intrinsics/const-eval-select-bad.stderr b/tests/ui/intrinsics/const-eval-select-bad.stderr index ecd08e3cdfd..e6ff9d5a0df 100644 --- a/tests/ui/intrinsics/const-eval-select-bad.stderr +++ b/tests/ui/intrinsics/const-eval-select-bad.stderr @@ -25,11 +25,11 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: expected a function item, found {integer} = help: consult the documentation on `const_eval_select` for more information -error[E0277]: expected a `FnOnce<()>` closure, found `{integer}` +error[E0277]: expected a `FnOnce()` closure, found `{integer}` --> $DIR/const-eval-select-bad.rs:10:27 | LL | const_eval_select((), 42, 0xDEADBEEF); - | ----------------- ^^ expected an `FnOnce<()>` closure, found `{integer}` + | ----------------- ^^ expected an `FnOnce()` closure, found `{integer}` | | | required by a bound introduced by this call | @@ -47,11 +47,11 @@ LL | const_eval_select((), 42, 0xDEADBEEF); = note: expected a function item, found {integer} = help: consult the documentation on `const_eval_select` for more information -error[E0277]: expected a `FnOnce<()>` closure, found `{integer}` +error[E0277]: expected a `FnOnce()` closure, found `{integer}` --> $DIR/const-eval-select-bad.rs:10:31 | LL | const_eval_select((), 42, 0xDEADBEEF); - | ----------------- ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}` + | ----------------- ^^^^^^^^^^ expected an `FnOnce()` closure, found `{integer}` | | | required by a bound introduced by this call | diff --git a/tests/ui/invalid/invalid-plugin-attr.rs b/tests/ui/invalid/invalid-plugin-attr.rs deleted file mode 100644 index 3080af24500..00000000000 --- a/tests/ui/invalid/invalid-plugin-attr.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![deny(unused_attributes)] -#![feature(plugin)] - -#[plugin(bla)] //~ ERROR should be an inner attribute -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui/invalid/invalid-plugin-attr.stderr b/tests/ui/invalid/invalid-plugin-attr.stderr deleted file mode 100644 index d3882d33fc4..00000000000 --- a/tests/ui/invalid/invalid-plugin-attr.stderr +++ /dev/null @@ -1,22 +0,0 @@ -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/invalid-plugin-attr.rs:4:1 - | -LL | #[plugin(bla)] - | ^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]` - --> $DIR/invalid-plugin-attr.rs:4:1 - | -LL | #[plugin(bla)] - | ^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/invalid-plugin-attr.rs:1:9 - | -LL | #![deny(unused_attributes)] - | ^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui/issues/issue-22034.rs b/tests/ui/issues/issue-22034.rs index 405ffd089c2..ed741779f68 100644 --- a/tests/ui/issues/issue-22034.rs +++ b/tests/ui/issues/issue-22034.rs @@ -6,6 +6,6 @@ fn main() { let ptr: *mut () = core::ptr::null_mut(); let _: &mut dyn Fn() = unsafe { &mut *(ptr as *mut dyn Fn()) - //~^ ERROR expected a `Fn<()>` closure, found `()` + //~^ ERROR expected a `Fn()` closure, found `()` }; } diff --git a/tests/ui/issues/issue-22034.stderr b/tests/ui/issues/issue-22034.stderr index 9833e559cbc..d64b024098c 100644 --- a/tests/ui/issues/issue-22034.stderr +++ b/tests/ui/issues/issue-22034.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `()` +error[E0277]: expected a `Fn()` closure, found `()` --> $DIR/issue-22034.rs:8:16 | LL | &mut *(ptr as *mut dyn Fn()) - | ^^^ expected an `Fn<()>` closure, found `()` + | ^^^ expected an `Fn()` closure, found `()` | = help: the trait `Fn<()>` is not implemented for `()` = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` diff --git a/tests/ui/issues/issue-23966.stderr b/tests/ui/issues/issue-23966.stderr index 8f934481d85..542aed0eb26 100644 --- a/tests/ui/issues/issue-23966.stderr +++ b/tests/ui/issues/issue-23966.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnMut<(_, char)>` closure, found `()` +error[E0277]: expected a `FnMut(_, char)` closure, found `()` --> $DIR/issue-23966.rs:2:32 | LL | "".chars().fold(|_, _| (), ()); - | ---- ^^ expected an `FnMut<(_, char)>` closure, found `()` + | ---- ^^ expected an `FnMut(_, char)` closure, found `()` | | | required by a bound introduced by this call | diff --git a/tests/ui/issues/issue-59494.rs b/tests/ui/issues/issue-59494.rs index a53e28f7246..8dcdd88c618 100644 --- a/tests/ui/issues/issue-59494.rs +++ b/tests/ui/issues/issue-59494.rs @@ -19,5 +19,5 @@ fn main() { let g = |(a, _)| a; let t7 = |env| |a| |b| t7p(f, g)(((env, a), b)); let t8 = t8n(t7, t7p(f, g)); - //~^ ERROR: expected a `Fn<(_,)>` closure, found `impl Fn(((_, _), _))` [E0277] + //~^ ERROR: expected a `Fn(_)` closure, found `impl Fn(((_, _), _))` [E0277] } diff --git a/tests/ui/issues/issue-59494.stderr b/tests/ui/issues/issue-59494.stderr index a9284535e4d..e9a4bf96741 100644 --- a/tests/ui/issues/issue-59494.stderr +++ b/tests/ui/issues/issue-59494.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(_,)>` closure, found `impl Fn(((_, _), _))` +error[E0277]: expected a `Fn(_)` closure, found `impl Fn(((_, _), _))` --> $DIR/issue-59494.rs:21:22 | LL | let t8 = t8n(t7, t7p(f, g)); - | --- ^^^^^^^^^ expected an `Fn<(_,)>` closure, found `impl Fn(((_, _), _))` + | --- ^^^^^^^^^ expected an `Fn(_)` closure, found `impl Fn(((_, _), _))` | | | required by a bound introduced by this call | diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs index 081e962028c..b0b6b318d8f 100644 --- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs +++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs @@ -4,14 +4,14 @@ use std::future::Future; async fn wrapper<F>(f: F) -//~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` -//~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` -//~| ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` +//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` +//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` where F:, for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, { - //~^ ERROR: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` + //~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` let mut i = 41; &mut i; } diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr b/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr index 9d8c15d4a6a..5b77051dc88 100644 --- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr +++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` +error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper<F>(f: F) @@ -8,19 +8,19 @@ LL | | LL | | where LL | | F:, LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, - | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` + | |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` -error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` +error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:10 | LL | async fn wrapper<F>(f: F) - | ^^^^^^^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` + | ^^^^^^^ expected an `FnOnce(&'a mut i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` -error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` +error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:13:1 | LL | / { @@ -28,11 +28,11 @@ LL | | LL | | let mut i = 41; LL | | &mut i; LL | | } - | |_^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` + | |_^ expected an `FnOnce(&'a mut i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` -error[E0277]: expected a `FnOnce<(&'a mut i32,)>` closure, found `i32` +error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` --> $DIR/issue-76168-hr-outlives-3.rs:6:1 | LL | / async fn wrapper<F>(f: F) @@ -42,7 +42,7 @@ LL | | LL | | where LL | | F:, LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, - | |______________________________________________________________________________^ expected an `FnOnce<(&'a mut i32,)>` closure, found `i32` + | |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` diff --git a/tests/ui/malformed/malformed-plugin-1.rs b/tests/ui/malformed/malformed-plugin-1.rs deleted file mode 100644 index d4c1a2a1679..00000000000 --- a/tests/ui/malformed/malformed-plugin-1.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(plugin)] -#![plugin] //~ ERROR malformed `plugin` attribute -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui/malformed/malformed-plugin-1.stderr b/tests/ui/malformed/malformed-plugin-1.stderr deleted file mode 100644 index 505f6b6f140..00000000000 --- a/tests/ui/malformed/malformed-plugin-1.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: malformed `plugin` attribute input - --> $DIR/malformed-plugin-1.rs:2:1 - | -LL | #![plugin] - | ^^^^^^^^^^ help: must be of the form: `#![plugin(name)]` - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/malformed-plugin-1.rs:2:1 - | -LL | #![plugin] - | ^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui/malformed/malformed-plugin-2.rs b/tests/ui/malformed/malformed-plugin-2.rs deleted file mode 100644 index ba80d97a3c2..00000000000 --- a/tests/ui/malformed/malformed-plugin-2.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(plugin)] -#![plugin="bleh"] //~ ERROR malformed `plugin` attribute -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui/malformed/malformed-plugin-2.stderr b/tests/ui/malformed/malformed-plugin-2.stderr deleted file mode 100644 index 52bbd82a389..00000000000 --- a/tests/ui/malformed/malformed-plugin-2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: malformed `plugin` attribute input - --> $DIR/malformed-plugin-2.rs:2:1 - | -LL | #![plugin="bleh"] - | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![plugin(name)]` - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/malformed-plugin-2.rs:2:1 - | -LL | #![plugin="bleh"] - | ^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - diff --git a/tests/ui/malformed/malformed-plugin-3.rs b/tests/ui/malformed/malformed-plugin-3.rs deleted file mode 100644 index d2bd8f9f8dc..00000000000 --- a/tests/ui/malformed/malformed-plugin-3.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(plugin)] -#![plugin(foo="bleh")] //~ ERROR malformed `plugin` attribute -//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated - -fn main() {} diff --git a/tests/ui/malformed/malformed-plugin-3.stderr b/tests/ui/malformed/malformed-plugin-3.stderr deleted file mode 100644 index 64cb429ea74..00000000000 --- a/tests/ui/malformed/malformed-plugin-3.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0498]: malformed `plugin` attribute - --> $DIR/malformed-plugin-3.rs:2:11 - | -LL | #![plugin(foo="bleh")] - | ^^^^^^^^^^ malformed attribute - -warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675 - --> $DIR/malformed-plugin-3.rs:2:1 - | -LL | #![plugin(foo="bleh")] - | ^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version - | - = note: `#[warn(deprecated)]` on by default - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0498`. diff --git a/tests/ui/mismatched_types/recovered-block.rs b/tests/ui/mismatched_types/recovered-block.rs index b230b47d35d..a91bbe7083b 100644 --- a/tests/ui/mismatched_types/recovered-block.rs +++ b/tests/ui/mismatched_types/recovered-block.rs @@ -12,10 +12,4 @@ pub fn foo() -> Foo { } //~^^ ERROR missing `struct` for struct definition -pub fn bar() -> Foo { - fn - Foo { text: "".to_string() } -} -//~^^ ERROR expected one of `(` or `<`, found `{` - fn main() {} diff --git a/tests/ui/mismatched_types/recovered-block.stderr b/tests/ui/mismatched_types/recovered-block.stderr index f275321abe5..88d62545656 100644 --- a/tests/ui/mismatched_types/recovered-block.stderr +++ b/tests/ui/mismatched_types/recovered-block.stderr @@ -9,11 +9,5 @@ help: add `struct` here to parse `Foo` as a public struct LL | pub struct Foo { text } | ++++++ -error: expected one of `(` or `<`, found `{` - --> $DIR/recovered-block.rs:17:9 - | -LL | Foo { text: "".to_string() } - | ^ expected one of `(` or `<` - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs index ac0831ce655..42adff43a58 100644 --- a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs +++ b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.rs @@ -24,9 +24,9 @@ fn main() { let _ = produces_string().and_then(takes_str_but_too_many_refs); //~^ ERROR type mismatch in function arguments let _ = produces_string().and_then(takes_str_but_wrong_abi); - //~^ ERROR expected a `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` + //~^ ERROR expected a `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` let _ = produces_string().and_then(takes_str_but_unsafe); - //~^ ERROR expected a `FnOnce<(String,)>` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` + //~^ ERROR expected a `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` let _ = produces_string().and_then(no_args); //~^ ERROR function is expected to take 1 argument, but it takes 0 arguments let _ = Some(TypeWithoutDeref).and_then(takes_str_but_too_many_refs); diff --git a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr index ecfbd27b180..3175a258906 100644 --- a/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr +++ b/tests/ui/mismatched_types/suggest-option-asderef-unfixable.stderr @@ -14,11 +14,11 @@ LL | let _ = produces_string().and_then(takes_str_but_too_many_refs); note: required by a bound in `Option::<T>::and_then` --> $SRC_DIR/core/src/option.rs:LL:COL -error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` +error[E0277]: expected a `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` --> $DIR/suggest-option-asderef-unfixable.rs:26:40 | LL | let _ = produces_string().and_then(takes_str_but_wrong_abi); - | -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(String,)>` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` + | -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce(String)` closure, found `for<'a> extern "C" fn(&'a str) -> Option<()> {takes_str_but_wrong_abi}` | | | required by a bound introduced by this call | @@ -26,7 +26,7 @@ LL | let _ = produces_string().and_then(takes_str_but_wrong_abi); note: required by a bound in `Option::<T>::and_then` --> $SRC_DIR/core/src/option.rs:LL:COL -error[E0277]: expected a `FnOnce<(String,)>` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` +error[E0277]: expected a `FnOnce(String)` closure, found `for<'a> unsafe fn(&'a str) -> Option<()> {takes_str_but_unsafe}` --> $DIR/suggest-option-asderef-unfixable.rs:28:40 | LL | let _ = produces_string().and_then(takes_str_but_unsafe); diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed b/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed new file mode 100644 index 00000000000..b819aa810cb --- /dev/null +++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.fixed @@ -0,0 +1,9 @@ +// run-rustfix + +pub fn missing() -> () {} +//~^ ERROR missing parameters for function definition + +pub fn missing2() {} +//~^ ERROR missing parameters for function definition + +fn main() {} diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.rs b/tests/ui/parser/issues/issue-108109-fn-missing-params.rs new file mode 100644 index 00000000000..01efe728081 --- /dev/null +++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.rs @@ -0,0 +1,9 @@ +// run-rustfix + +pub fn missing -> () {} +//~^ ERROR missing parameters for function definition + +pub fn missing2 {} +//~^ ERROR missing parameters for function definition + +fn main() {} diff --git a/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr new file mode 100644 index 00000000000..86d3449cc33 --- /dev/null +++ b/tests/ui/parser/issues/issue-108109-fn-missing-params.stderr @@ -0,0 +1,14 @@ +error: missing parameters for function definition + --> $DIR/issue-108109-fn-missing-params.rs:3:15 + | +LL | pub fn missing -> () {} + | ^ help: add a parameter list + +error: missing parameters for function definition + --> $DIR/issue-108109-fn-missing-params.rs:6:16 + | +LL | pub fn missing2 {} + | ^ help: add a parameter list + +error: aborting due to 2 previous errors + diff --git a/tests/ui/parser/removed-syntax-fn-sigil.rs b/tests/ui/parser/removed-syntax-fn-sigil.rs index 725843429c0..d55a032d1f2 100644 --- a/tests/ui/parser/removed-syntax-fn-sigil.rs +++ b/tests/ui/parser/removed-syntax-fn-sigil.rs @@ -1,3 +1,4 @@ fn main() { - let x: fn~() = || (); //~ ERROR expected `(`, found `~` + let x: fn~() = || (); //~ ERROR missing parameters for function definition + //~| ERROR expected one of `->`, `;`, or `=`, found `~` } diff --git a/tests/ui/parser/removed-syntax-fn-sigil.stderr b/tests/ui/parser/removed-syntax-fn-sigil.stderr index 196a5af4729..0d377416700 100644 --- a/tests/ui/parser/removed-syntax-fn-sigil.stderr +++ b/tests/ui/parser/removed-syntax-fn-sigil.stderr @@ -1,10 +1,14 @@ -error: expected `(`, found `~` +error: missing parameters for function definition --> $DIR/removed-syntax-fn-sigil.rs:2:14 | LL | let x: fn~() = || (); - | - ^ expected `(` - | | - | while parsing the type for `x` + | ^ help: add a parameter list -error: aborting due to previous error +error: expected one of `->`, `;`, or `=`, found `~` + --> $DIR/removed-syntax-fn-sigil.rs:2:14 + | +LL | let x: fn~() = || (); + | ^ expected one of `->`, `;`, or `=` + +error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs index 43bda49624e..1374ad935a3 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.rs @@ -21,14 +21,14 @@ fn call_once(f: impl FnOnce()) { } fn main() { - call(foo); //~ ERROR expected a `Fn<()>` closure, found `fn() {foo}` - call_mut(foo); //~ ERROR expected a `FnMut<()>` closure, found `fn() {foo}` - call_once(foo); //~ ERROR expected a `FnOnce<()>` closure, found `fn() {foo}` + call(foo); //~ ERROR expected a `Fn()` closure, found `fn() {foo}` + call_mut(foo); //~ ERROR expected a `FnMut()` closure, found `fn() {foo}` + call_once(foo); //~ ERROR expected a `FnOnce()` closure, found `fn() {foo}` call(foo_unsafe); - //~^ ERROR expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` call_mut(foo_unsafe); - //~^ ERROR expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` call_once(foo_unsafe); - //~^ ERROR expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` + //~^ ERROR expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` } diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr index 4fb0d43d1b7..100f2048269 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}` +error[E0277]: expected a `Fn()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:24:10 | LL | call(foo); - | ---- ^^^ expected an `Fn<()>` closure, found `fn() {foo}` + | ---- ^^^ expected an `Fn()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -15,11 +15,11 @@ note: required by a bound in `call` LL | fn call(f: impl Fn()) { | ^^^^ required by this bound in `call` -error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}` +error[E0277]: expected a `FnMut()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:25:14 | LL | call_mut(foo); - | -------- ^^^ expected an `FnMut<()>` closure, found `fn() {foo}` + | -------- ^^^ expected an `FnMut()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -32,11 +32,11 @@ note: required by a bound in `call_mut` LL | fn call_mut(f: impl FnMut()) { | ^^^^^^^ required by this bound in `call_mut` -error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}` +error[E0277]: expected a `FnOnce()` closure, found `fn() {foo}` --> $DIR/fn-traits.rs:26:15 | LL | call_once(foo); - | --------- ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}` + | --------- ^^^ expected an `FnOnce()` closure, found `fn() {foo}` | | | required by a bound introduced by this call | @@ -49,7 +49,7 @@ note: required by a bound in `call_once` LL | fn call_once(f: impl FnOnce()) { | ^^^^^^^^ required by this bound in `call_once` -error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `Fn()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:28:10 | LL | call(foo_unsafe); @@ -67,7 +67,7 @@ note: required by a bound in `call` LL | fn call(f: impl Fn()) { | ^^^^ required by this bound in `call` -error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `FnMut()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:30:14 | LL | call_mut(foo_unsafe); @@ -85,7 +85,7 @@ note: required by a bound in `call_mut` LL | fn call_mut(f: impl FnMut()) { | ^^^^^^^ required by this bound in `call_mut` -error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}` +error[E0277]: expected a `FnOnce()` closure, found `unsafe fn() {foo_unsafe}` --> $DIR/fn-traits.rs:32:15 | LL | call_once(foo_unsafe); diff --git a/tests/ui/suggestions/issue-104961.fixed b/tests/ui/suggestions/issue-104961.fixed index 520d638b174..36917cf3395 100644 --- a/tests/ui/suggestions/issue-104961.fixed +++ b/tests/ui/suggestions/issue-104961.fixed @@ -2,12 +2,12 @@ fn foo(x: &str) -> bool { x.starts_with(&("hi".to_string() + " you")) - //~^ ERROR expected a `FnMut<(char,)>` closure, found `String` + //~^ ERROR expected a `FnMut(char)` closure, found `String` } fn foo2(x: &str) -> bool { x.starts_with(&"hi".to_string()) - //~^ ERROR expected a `FnMut<(char,)>` closure, found `String` + //~^ ERROR expected a `FnMut(char)` closure, found `String` } fn main() { diff --git a/tests/ui/suggestions/issue-104961.rs b/tests/ui/suggestions/issue-104961.rs index aeb787abb6f..25a8e0c45e8 100644 --- a/tests/ui/suggestions/issue-104961.rs +++ b/tests/ui/suggestions/issue-104961.rs @@ -2,12 +2,12 @@ fn foo(x: &str) -> bool { x.starts_with("hi".to_string() + " you") - //~^ ERROR expected a `FnMut<(char,)>` closure, found `String` + //~^ ERROR expected a `FnMut(char)` closure, found `String` } fn foo2(x: &str) -> bool { x.starts_with("hi".to_string()) - //~^ ERROR expected a `FnMut<(char,)>` closure, found `String` + //~^ ERROR expected a `FnMut(char)` closure, found `String` } fn main() { diff --git a/tests/ui/suggestions/issue-104961.stderr b/tests/ui/suggestions/issue-104961.stderr index 8cec6a3f827..7e795a74c90 100644 --- a/tests/ui/suggestions/issue-104961.stderr +++ b/tests/ui/suggestions/issue-104961.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnMut<(char,)>` closure, found `String` +error[E0277]: expected a `FnMut(char)` closure, found `String` --> $DIR/issue-104961.rs:4:19 | LL | x.starts_with("hi".to_string() + " you") @@ -15,7 +15,7 @@ help: consider borrowing here LL | x.starts_with(&("hi".to_string() + " you")) | ++ + -error[E0277]: expected a `FnMut<(char,)>` closure, found `String` +error[E0277]: expected a `FnMut(char)` closure, found `String` --> $DIR/issue-104961.rs:9:19 | LL | x.starts_with("hi".to_string()) diff --git a/tests/ui/suggestions/issue-62843.stderr b/tests/ui/suggestions/issue-62843.stderr index b6e271de807..ead8f18547b 100644 --- a/tests/ui/suggestions/issue-62843.stderr +++ b/tests/ui/suggestions/issue-62843.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnMut<(char,)>` closure, found `String` +error[E0277]: expected a `FnMut(char)` closure, found `String` --> $DIR/issue-62843.rs:4:32 | LL | println!("{:?}", line.find(pattern)); diff --git a/tests/ui/symbol-mangling-version/bad-value.bad.stderr b/tests/ui/symbol-mangling-version/bad-value.bad.stderr new file mode 100644 index 00000000000..c36c73c6069 --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.bad.stderr @@ -0,0 +1,2 @@ +error: incorrect value `bad-value` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected + diff --git a/tests/ui/symbol-mangling-version/bad-value.blank.stderr b/tests/ui/symbol-mangling-version/bad-value.blank.stderr new file mode 100644 index 00000000000..0e70af5b8ff --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.blank.stderr @@ -0,0 +1,2 @@ +error: incorrect value `` for codegen option `symbol-mangling-version` - either `legacy` or `v0` (RFC 2603) was expected + diff --git a/tests/ui/symbol-mangling-version/bad-value.no-value.stderr b/tests/ui/symbol-mangling-version/bad-value.no-value.stderr new file mode 100644 index 00000000000..77013b72b6c --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.no-value.stderr @@ -0,0 +1,2 @@ +error: codegen option `symbol-mangling-version` requires either `legacy` or `v0` (RFC 2603) (C symbol-mangling-version=<value>) + diff --git a/tests/ui/symbol-mangling-version/bad-value.rs b/tests/ui/symbol-mangling-version/bad-value.rs new file mode 100644 index 00000000000..7623857d49e --- /dev/null +++ b/tests/ui/symbol-mangling-version/bad-value.rs @@ -0,0 +1,6 @@ +// revisions: no-value blank bad +// [no-value] compile-flags: -Csymbol-mangling-version +// [blank] compile-flags: -Csymbol-mangling-version= +// [bad] compile-flags: -Csymbol-mangling-version=bad-value + +fn main() {} diff --git a/tests/ui/symbol-mangling-version/stable.rs b/tests/ui/symbol-mangling-version/stable.rs new file mode 100644 index 00000000000..dac9bb18d1c --- /dev/null +++ b/tests/ui/symbol-mangling-version/stable.rs @@ -0,0 +1,5 @@ +// check-pass +// revisions: v0 +// [v0] compile-flags: -Csymbol-mangling-version=v0 + +fn main() {} diff --git a/tests/ui/symbol-mangling-version/unstable.legacy.stderr b/tests/ui/symbol-mangling-version/unstable.legacy.stderr new file mode 100644 index 00000000000..c5b359b41bd --- /dev/null +++ b/tests/ui/symbol-mangling-version/unstable.legacy.stderr @@ -0,0 +1,2 @@ +error: `-C symbol-mangling-version=legacy` requires `-Z unstable-options` + diff --git a/tests/ui/symbol-mangling-version/unstable.rs b/tests/ui/symbol-mangling-version/unstable.rs new file mode 100644 index 00000000000..df87a39cdfb --- /dev/null +++ b/tests/ui/symbol-mangling-version/unstable.rs @@ -0,0 +1,6 @@ +// revisions: legacy legacy-ok +// [legacy] compile-flags: -Csymbol-mangling-version=legacy +// [legacy-ok] check-pass +// [legacy-ok] compile-flags: -Zunstable-options -Csymbol-mangling-version=legacy + +fn main() {} diff --git a/tests/ui/trait-bounds/mismatch-fn-trait.stderr b/tests/ui/trait-bounds/mismatch-fn-trait.stderr index 961e6d88fbe..519aa9ea3f3 100644 --- a/tests/ui/trait-bounds/mismatch-fn-trait.stderr +++ b/tests/ui/trait-bounds/mismatch-fn-trait.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(u32)` +error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut(u32)` --> $DIR/mismatch-fn-trait.rs:4:10 | LL | take(f) - | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(u32)` + | ---- ^ expected an `FnMut(i32)` closure, found `impl FnMut(u32)` | | | required by a bound introduced by this call | @@ -14,11 +14,11 @@ note: required by a bound in `take` LL | fn take(_f: impl FnMut(i32)) {} | ^^^^^^^^^^ required by this bound in `take` -error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)` +error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut(i32, i32)` --> $DIR/mismatch-fn-trait.rs:9:10 | LL | take(f) - | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut(i32, i32)` + | ---- ^ expected an `FnMut(i32)` closure, found `impl FnMut(i32, i32)` | | | required by a bound introduced by this call | @@ -29,11 +29,11 @@ note: required by a bound in `take` LL | fn take(_f: impl FnMut(i32)) {} | ^^^^^^^^^^ required by this bound in `take` -error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnMut()` +error[E0277]: expected a `FnMut(i32)` closure, found `impl FnMut()` --> $DIR/mismatch-fn-trait.rs:14:10 | LL | take(f) - | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnMut()` + | ---- ^ expected an `FnMut(i32)` closure, found `impl FnMut()` | | | required by a bound introduced by this call | @@ -44,11 +44,11 @@ note: required by a bound in `take` LL | fn take(_f: impl FnMut(i32)) {} | ^^^^^^^^^^ required by this bound in `take` -error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(i32)` +error[E0277]: expected a `FnMut(i32)` closure, found `impl FnOnce(i32)` --> $DIR/mismatch-fn-trait.rs:19:10 | LL | take(f) - | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(i32)` + | ---- ^ expected an `FnMut(i32)` closure, found `impl FnOnce(i32)` | | | required by a bound introduced by this call | @@ -59,11 +59,11 @@ note: required by a bound in `take` LL | fn take(_f: impl FnMut(i32)) {} | ^^^^^^^^^^ required by this bound in `take` -error[E0277]: expected a `FnMut<(i32,)>` closure, found `impl FnOnce(u32)` +error[E0277]: expected a `FnMut(i32)` closure, found `impl FnOnce(u32)` --> $DIR/mismatch-fn-trait.rs:24:10 | LL | take(f) - | ---- ^ expected an `FnMut<(i32,)>` closure, found `impl FnOnce(u32)` + | ---- ^ expected an `FnMut(i32)` closure, found `impl FnOnce(u32)` | | | required by a bound introduced by this call | diff --git a/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs index eb2fb6e841b..1359eb6cb87 100644 --- a/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs +++ b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs @@ -11,5 +11,5 @@ fn f<T: for<'r> X<'r> + ?Sized>() { fn main() { f::<dyn for<'x> X<'x, F = i32>>(); - //~^ expected a `FnOnce<(&i32,)>` closure, found `i32` + //~^ expected a `FnOnce(&i32)` closure, found `i32` } diff --git a/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr index 10e82c54e0f..68b9319d65c 100644 --- a/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr +++ b/tests/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32` +error[E0277]: expected a `FnOnce(&i32)` closure, found `i32` --> $DIR/check-trait-object-bounds-2.rs:13:9 | LL | f::<dyn for<'x> X<'x, F = i32>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce(&i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a i32,)>` is not implemented for `i32` note: required by a bound in `f` diff --git a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs index f9a93476411..f8e3f8e968e 100644 --- a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs +++ b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs @@ -1,7 +1,7 @@ fn strip_lf(s: &str) -> &str { s.strip_suffix(b'\n').unwrap_or(s) - //~^ ERROR expected a `FnMut<(char,)>` closure, found `u8` - //~| NOTE expected an `FnMut<(char,)>` closure, found `u8` + //~^ ERROR expected a `FnMut(char)` closure, found `u8` + //~| NOTE expected an `FnMut(char)` closure, found `u8` //~| HELP the trait `FnMut<(char,)>` is not implemented for `u8` //~| HELP the following other types implement trait `Pattern<'a>`: //~| NOTE required for `u8` to implement `Pattern<'_>` diff --git a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr index b1c683e4729..f30fe12b216 100644 --- a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr +++ b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnMut<(char,)>` closure, found `u8` +error[E0277]: expected a `FnMut(char)` closure, found `u8` --> $DIR/assoc-fn-bound-root-obligation.rs:2:7 | LL | s.strip_suffix(b'\n').unwrap_or(s) - | ^^^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `u8` + | ^^^^^^^^^^^^ expected an `FnMut(char)` closure, found `u8` | = help: the trait `FnMut<(char,)>` is not implemented for `u8` = help: the following other types implement trait `Pattern<'a>`: diff --git a/tests/ui/traits/new-solver/fn-trait.rs b/tests/ui/traits/new-solver/fn-trait.rs index 0599e51d7ad..0a19e626553 100644 --- a/tests/ui/traits/new-solver/fn-trait.rs +++ b/tests/ui/traits/new-solver/fn-trait.rs @@ -18,15 +18,15 @@ fn main() { require_fn(f); require_fn(f as fn() -> i32); require_fn(f as unsafe fn() -> i32); - //~^ ERROR: expected a `Fn<()>` closure, found `unsafe fn() -> i32` + //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32` //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 as FnOnce<()>>::Output == i32` require_fn(g); - //~^ ERROR: expected a `Fn<()>` closure, found `extern "C" fn() -> i32 {g}` + //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 {g} as FnOnce<()>>::Output == i32` require_fn(g as extern "C" fn() -> i32); - //~^ ERROR: expected a `Fn<()>` closure, found `extern "C" fn() -> i32` + //~^ ERROR: expected a `Fn()` closure, found `extern "C" fn() -> i32` //~| ERROR: type mismatch resolving `<extern "C" fn() -> i32 as FnOnce<()>>::Output == i32` require_fn(h); - //~^ ERROR: expected a `Fn<()>` closure, found `unsafe fn() -> i32 {h}` + //~^ ERROR: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` //~| ERROR: type mismatch resolving `<unsafe fn() -> i32 {h} as FnOnce<()>>::Output == i32` } diff --git a/tests/ui/traits/new-solver/fn-trait.stderr b/tests/ui/traits/new-solver/fn-trait.stderr index ff6903c5dbf..e33487235e6 100644 --- a/tests/ui/traits/new-solver/fn-trait.stderr +++ b/tests/ui/traits/new-solver/fn-trait.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() -> i32` +error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32` --> $DIR/fn-trait.rs:20:16 | LL | require_fn(f as unsafe fn() -> i32); @@ -29,11 +29,11 @@ note: required by a bound in `require_fn` LL | fn require_fn(_: impl Fn() -> i32) {} | ^^^ required by this bound in `require_fn` -error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() -> i32 {g}` +error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32 {g}` --> $DIR/fn-trait.rs:23:16 | LL | require_fn(g); - | ---------- ^ expected an `Fn<()>` closure, found `extern "C" fn() -> i32 {g}` + | ---------- ^ expected an `Fn()` closure, found `extern "C" fn() -> i32 {g}` | | | required by a bound introduced by this call | @@ -59,11 +59,11 @@ note: required by a bound in `require_fn` LL | fn require_fn(_: impl Fn() -> i32) {} | ^^^ required by this bound in `require_fn` -error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() -> i32` +error[E0277]: expected a `Fn()` closure, found `extern "C" fn() -> i32` --> $DIR/fn-trait.rs:26:16 | LL | require_fn(g as extern "C" fn() -> i32); - | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `extern "C" fn() -> i32` + | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn()` closure, found `extern "C" fn() -> i32` | | | required by a bound introduced by this call | @@ -89,7 +89,7 @@ note: required by a bound in `require_fn` LL | fn require_fn(_: impl Fn() -> i32) {} | ^^^ required by this bound in `require_fn` -error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() -> i32 {h}` +error[E0277]: expected a `Fn()` closure, found `unsafe fn() -> i32 {h}` --> $DIR/fn-trait.rs:29:16 | LL | require_fn(h); diff --git a/tests/ui/traits/new-solver/specialization-transmute.rs b/tests/ui/traits/new-solver/specialization-transmute.rs index 7523b828321..f6b19e7adf5 100644 --- a/tests/ui/traits/new-solver/specialization-transmute.rs +++ b/tests/ui/traits/new-solver/specialization-transmute.rs @@ -10,7 +10,7 @@ trait Default { } impl<T> Default for T { - default type Id = T; //~ ERROR: type annotations needed + default type Id = T; // This will be fixed by #111994 fn intu(&self) -> &Self::Id { //~ ERROR type annotations needed self diff --git a/tests/ui/traits/new-solver/specialization-transmute.stderr b/tests/ui/traits/new-solver/specialization-transmute.stderr index 18965a465b3..09b1405fefb 100644 --- a/tests/ui/traits/new-solver/specialization-transmute.stderr +++ b/tests/ui/traits/new-solver/specialization-transmute.stderr @@ -16,13 +16,6 @@ LL | fn intu(&self) -> &Self::Id { | = note: cannot satisfy `<T as Default>::Id == _` -error[E0282]: type annotations needed - --> $DIR/specialization-transmute.rs:13:23 - | -LL | default type Id = T; - | ^ cannot infer type for associated type `<T as Default>::Id` - -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to previous error; 1 warning emitted -Some errors have detailed explanations: E0282, E0284. -For more information about an error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0284`. diff --git a/tests/ui/traits/new-solver/specialization-unconstrained.rs b/tests/ui/traits/new-solver/specialization-unconstrained.rs index 7fd753109be..02150689ee5 100644 --- a/tests/ui/traits/new-solver/specialization-unconstrained.rs +++ b/tests/ui/traits/new-solver/specialization-unconstrained.rs @@ -11,7 +11,7 @@ trait Default { } impl<T> Default for T { - default type Id = T; //~ ERROR type annotations needed + default type Id = T; } fn test<T: Default<Id = U>, U>() {} diff --git a/tests/ui/traits/new-solver/specialization-unconstrained.stderr b/tests/ui/traits/new-solver/specialization-unconstrained.stderr index ed4dafa1484..910925cbaeb 100644 --- a/tests/ui/traits/new-solver/specialization-unconstrained.stderr +++ b/tests/ui/traits/new-solver/specialization-unconstrained.stderr @@ -20,13 +20,6 @@ note: required by a bound in `test` LL | fn test<T: Default<Id = U>, U>() {} | ^^^^^^ required by this bound in `test` -error[E0282]: type annotations needed - --> $DIR/specialization-unconstrained.rs:14:22 - | -LL | default type Id = T; - | ^ cannot infer type for associated type `<T as Default>::Id` - -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to previous error; 1 warning emitted -Some errors have detailed explanations: E0282, E0284. -For more information about an error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0284`. diff --git a/tests/ui/traits/suggest-dereferences/root-obligation.fixed b/tests/ui/traits/suggest-dereferences/root-obligation.fixed index 7a8433f9057..d03d733c76d 100644 --- a/tests/ui/traits/suggest-dereferences/root-obligation.fixed +++ b/tests/ui/traits/suggest-dereferences/root-obligation.fixed @@ -4,7 +4,7 @@ fn get_vowel_count(string: &str) -> usize { string .chars() .filter(|c| "aeiou".contains(*c)) - //~^ ERROR expected a `Fn<(char,)>` closure, found `char` + //~^ ERROR expected a `Fn(char)` closure, found `char` .count() } diff --git a/tests/ui/traits/suggest-dereferences/root-obligation.rs b/tests/ui/traits/suggest-dereferences/root-obligation.rs index 51bac2107e3..9d9ffb3f55e 100644 --- a/tests/ui/traits/suggest-dereferences/root-obligation.rs +++ b/tests/ui/traits/suggest-dereferences/root-obligation.rs @@ -4,7 +4,7 @@ fn get_vowel_count(string: &str) -> usize { string .chars() .filter(|c| "aeiou".contains(c)) - //~^ ERROR expected a `Fn<(char,)>` closure, found `char` + //~^ ERROR expected a `Fn(char)` closure, found `char` .count() } diff --git a/tests/ui/traits/suggest-dereferences/root-obligation.stderr b/tests/ui/traits/suggest-dereferences/root-obligation.stderr index 1363fb8c47a..a19708e46bb 100644 --- a/tests/ui/traits/suggest-dereferences/root-obligation.stderr +++ b/tests/ui/traits/suggest-dereferences/root-obligation.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(char,)>` closure, found `char` +error[E0277]: expected a `Fn(char)` closure, found `char` --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) - | -------- ^ expected an `Fn<(char,)>` closure, found `char` + | -------- ^ expected an `Fn(char)` closure, found `char` | | | required by a bound introduced by this call | diff --git a/tests/ui/type-alias-impl-trait/issue-63279.rs b/tests/ui/type-alias-impl-trait/issue-63279.rs index 0e46745c65c..02f2111468a 100644 --- a/tests/ui/type-alias-impl-trait/issue-63279.rs +++ b/tests/ui/type-alias-impl-trait/issue-63279.rs @@ -3,11 +3,11 @@ type Closure = impl FnOnce(); fn c() -> Closure { - //~^ ERROR: expected a `FnOnce<()>` closure, found `()` + //~^ ERROR: expected a `FnOnce()` closure, found `()` || -> Closure { || () } //~^ ERROR: mismatched types //~| ERROR: mismatched types - //~| ERROR: expected a `FnOnce<()>` closure, found `()` + //~| ERROR: expected a `FnOnce()` closure, found `()` } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-63279.stderr b/tests/ui/type-alias-impl-trait/issue-63279.stderr index a868562479e..58cafd21ca8 100644 --- a/tests/ui/type-alias-impl-trait/issue-63279.stderr +++ b/tests/ui/type-alias-impl-trait/issue-63279.stderr @@ -1,17 +1,17 @@ -error[E0277]: expected a `FnOnce<()>` closure, found `()` +error[E0277]: expected a `FnOnce()` closure, found `()` --> $DIR/issue-63279.rs:5:11 | LL | fn c() -> Closure { - | ^^^^^^^ expected an `FnOnce<()>` closure, found `()` + | ^^^^^^^ expected an `FnOnce()` closure, found `()` | = help: the trait `FnOnce<()>` is not implemented for `()` = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` -error[E0277]: expected a `FnOnce<()>` closure, found `()` +error[E0277]: expected a `FnOnce()` closure, found `()` --> $DIR/issue-63279.rs:7:11 | LL | || -> Closure { || () } - | ^^^^^^^ expected an `FnOnce<()>` closure, found `()` + | ^^^^^^^ expected an `FnOnce()` closure, found `()` | = help: the trait `FnOnce<()>` is not implemented for `()` = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` diff --git a/tests/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr b/tests/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr index 0ea1c1dcd5b..ce4d0fe25f5 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(isize,)>` closure, found `S` +error[E0277]: expected a `Fn(isize)` closure, found `S` --> $DIR/unboxed-closures-fnmut-as-fn.rs:27:21 | LL | let x = call_it(&S, 22); - | ------- ^^ expected an `Fn<(isize,)>` closure, found `S` + | ------- ^^ expected an `Fn(isize)` closure, found `S` | | | required by a bound introduced by this call | diff --git a/tests/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/tests/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr index 802696e1b2f..d836af2b014 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` +error[E0277]: expected a `Fn(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21 | LL | let x = call_it(&square, 22); @@ -14,7 +14,7 @@ note: required by a bound in `call_it` LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` -error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` +error[E0277]: expected a `FnMut(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25 | LL | let y = call_it_mut(&mut square, 22); @@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut` LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` -error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` +error[E0277]: expected a `FnOnce(&isize)` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26 | LL | let z = call_it_once(square, 22); diff --git a/tests/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/tests/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr index 0bbb9836c58..c0dcf83a5bb 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` +error[E0277]: expected a `Fn(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:20:21 | LL | let x = call_it(&square, 22); - | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` + | ------- ^^^^^^^ expected an `Fn(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | @@ -13,11 +13,11 @@ note: required by a bound in `call_it` LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` -error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` +error[E0277]: expected a `FnMut(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:25:25 | LL | let y = call_it_mut(&mut square, 22); - | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` + | ----------- ^^^^^^^^^^^ expected an `FnMut(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | @@ -28,11 +28,11 @@ note: required by a bound in `call_it_mut` LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` -error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` +error[E0277]: expected a `FnOnce(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-abi.rs:30:26 | LL | let z = call_it_once(square, 22); - | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` + | ------------ ^^^^^^ expected an `FnOnce(&isize)` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}` | | | required by a bound introduced by this call | diff --git a/tests/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/tests/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr index 31a66790ce0..d261c38f50c 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` +error[E0277]: expected a `Fn(&isize)` closure, found `unsafe fn(isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:21:21 | LL | let x = call_it(&square, 22); @@ -14,7 +14,7 @@ note: required by a bound in `call_it` LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it` -error[E0277]: expected a `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` +error[E0277]: expected a `FnMut(&isize)` closure, found `unsafe fn(isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:26:25 | LL | let y = call_it_mut(&mut square, 22); @@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut` LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut` -error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` +error[E0277]: expected a `FnOnce(&isize)` closure, found `unsafe fn(isize) -> isize {square}` --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:31:26 | LL | let z = call_it_once(square, 22); diff --git a/tests/ui/unsafe/initializing-ranged-via-ctor.stderr b/tests/ui/unsafe/initializing-ranged-via-ctor.stderr index d34554c6641..13438fd31d0 100644 --- a/tests/ui/unsafe/initializing-ranged-via-ctor.stderr +++ b/tests/ui/unsafe/initializing-ranged-via-ctor.stderr @@ -1,4 +1,4 @@ -error[E0277]: expected a `FnOnce<({integer},)>` closure, found `unsafe fn(u8) -> NonZeroAndOneU8 {NonZeroAndOneU8}` +error[E0277]: expected a `FnOnce({integer})` closure, found `unsafe fn(u8) -> NonZeroAndOneU8 {NonZeroAndOneU8}` --> $DIR/initializing-ranged-via-ctor.rs:9:34 | LL | println!("{:?}", Some(1).map(NonZeroAndOneU8).unwrap()); diff --git a/tests/ui/unsized/unsize-coerce-multiple-adt-params.rs b/tests/ui/unsized/unsize-coerce-multiple-adt-params.rs new file mode 100644 index 00000000000..eba341ff284 --- /dev/null +++ b/tests/ui/unsized/unsize-coerce-multiple-adt-params.rs @@ -0,0 +1,29 @@ +// check-pass + +struct Foo<T, U> +where + (T, U): Trait, +{ + f: <(T, U) as Trait>::Assoc, +} + +trait Trait { + type Assoc: ?Sized; +} + +struct Count<const N: usize>; + +impl<const N: usize> Trait for (i32, Count<N>) { + type Assoc = [(); N]; +} + +impl<'a> Trait for (u32, ()) { + type Assoc = [()]; +} + +// Test that we can unsize several trait params in creative ways. +fn unsize<const N: usize>(x: &Foo<i32, Count<N>>) -> &Foo<u32, ()> { + x +} + +fn main() {} |
