diff options
| author | bors <bors@rust-lang.org> | 2025-08-05 01:53:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-05 01:53:59 +0000 |
| commit | 0f353363965ebf05e0757f7679c800b39c51a07e (patch) | |
| tree | ba4c09b6d1616f0505e88cf7d9c76f7b0ed45e5b /tests | |
| parent | 0060d5a2a8a86a31f6299311fe64b1d755a91c4f (diff) | |
| parent | 5c11681820a843da59d7b9c5e848f3e9e7fd0f62 (diff) | |
| download | rust-0f353363965ebf05e0757f7679c800b39c51a07e.tar.gz rust-0f353363965ebf05e0757f7679c800b39c51a07e.zip | |
Auto merge of #144934 - samueltardieu:rollup-25jvb9g, r=samueltardieu
Rollup of 17 pull requests Successful merges: - rust-lang/rust#144467 (rustdoc template font links only emit `crossorigin` when needed) - rust-lang/rust#144548 (Rehome 21 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`) - rust-lang/rust#144741 (fix: Error on illegal `[const]`s inside blocks within legal positions) - rust-lang/rust#144776 (`Printer` cleanups) - rust-lang/rust#144779 (Implement debugging output of the bootstrap Step graph into a DOT file) - rust-lang/rust#144813 (Add a tidy check to prevent adding UI tests directly under `tests/ui/`) - rust-lang/rust#144817 (Properly reject tail calls to `&FnPtr` or `&FnDef`) - rust-lang/rust#144852 (Rename `rust_panic_without_hook` to `resume_unwind` ) - rust-lang/rust#144866 (Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`) - rust-lang/rust#144867 (Use `as_array` in PartialEq for arrays) - rust-lang/rust#144872 (Document Poisoning in `LazyCell` and `LazyLock`) - rust-lang/rust#144877 (coverage: Various small cleanups) - rust-lang/rust#144887 (`rust-analyzer` subtree update) - rust-lang/rust#144890 (Add `InterpCx::project_fields`) - rust-lang/rust#144894 (Delete `tests/ui/threads-sendsync/tcp-stress.rs`) - rust-lang/rust#144905 (rustc-dev-guide subtree update) - rust-lang/rust#144920 (Dont print arg span in MIR dump for tail call) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
53 files changed, 323 insertions, 376 deletions
diff --git a/tests/coverage/branch/no-mir-spans.cov-map b/tests/coverage/branch/no-mir-spans.cov-map deleted file mode 100644 index 4f893cba1f8..00000000000 --- a/tests/coverage/branch/no-mir-spans.cov-map +++ /dev/null @@ -1,63 +0,0 @@ -Function name: no_mir_spans::while_cond -Raw bytes (18): 0x[01, 01, 01, 05, 01, 02, 01, 10, 01, 00, 10, 20, 02, 01, 04, 0b, 00, 10] -Number of files: 1 -- file 0 => $DIR/no-mir-spans.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 16) -- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 4, 11) to (start + 0, 16) - true = (c1 - c0) - false = c0 -Highest counter ID seen: c0 - -Function name: no_mir_spans::while_cond_not -Raw bytes (18): 0x[01, 01, 01, 05, 01, 02, 01, 19, 01, 00, 14, 20, 02, 01, 04, 0b, 00, 14] -Number of files: 1 -- file 0 => $DIR/no-mir-spans.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 25, 1) to (start + 0, 20) -- Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 4, 11) to (start + 0, 20) - true = (c1 - c0) - false = c0 -Highest counter ID seen: c0 - -Function name: no_mir_spans::while_op_and -Raw bytes (31): 0x[01, 01, 04, 09, 05, 09, 01, 0f, 09, 01, 05, 03, 01, 22, 01, 00, 12, 20, 05, 02, 05, 0b, 00, 10, 20, 06, 0a, 00, 14, 00, 19] -Number of files: 1 -- file 0 => $DIR/no-mir-spans.rs -Number of expressions: 4 -- expression 0 operands: lhs = Counter(2), rhs = Counter(1) -- expression 1 operands: lhs = Counter(2), rhs = Counter(0) -- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(2) -- expression 3 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 34, 1) to (start + 0, 18) -- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 5, 11) to (start + 0, 16) - true = c1 - false = (c2 - c1) -- Branch { true: Expression(1, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25) - true = (c2 - c0) - false = ((c0 + c1) - c2) -Highest counter ID seen: c1 - -Function name: no_mir_spans::while_op_or -Raw bytes (29): 0x[01, 01, 03, 09, 05, 09, 0b, 01, 05, 03, 01, 2d, 01, 00, 11, 20, 05, 02, 05, 0b, 00, 10, 20, 06, 01, 00, 14, 00, 19] -Number of files: 1 -- file 0 => $DIR/no-mir-spans.rs -Number of expressions: 3 -- expression 0 operands: lhs = Counter(2), rhs = Counter(1) -- expression 1 operands: lhs = Counter(2), rhs = Expression(2, Add) -- expression 2 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 45, 1) to (start + 0, 17) -- Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 5, 11) to (start + 0, 16) - true = c1 - false = (c2 - c1) -- Branch { true: Expression(1, Sub), false: Counter(0) } at (prev + 0, 20) to (start + 0, 25) - true = (c2 - (c0 + c1)) - false = c0 -Highest counter ID seen: c1 - diff --git a/tests/coverage/branch/no-mir-spans.coverage b/tests/coverage/branch/no-mir-spans.coverage deleted file mode 100644 index 2cae98ed3ff..00000000000 --- a/tests/coverage/branch/no-mir-spans.coverage +++ /dev/null @@ -1,77 +0,0 @@ - LL| |#![feature(coverage_attribute)] - LL| |//@ edition: 2021 - LL| |//@ compile-flags: -Zcoverage-options=branch,no-mir-spans - LL| |//@ llvm-cov-flags: --show-branches=count - LL| | - LL| |// Tests the behaviour of the `-Zcoverage-options=no-mir-spans` debugging flag. - LL| |// The actual code below is just some non-trivial code copied from another test - LL| |// (`while.rs`), and has no particular significance. - LL| | - LL| |macro_rules! no_merge { - LL| | () => { - LL| | for _ in 0..1 {} - LL| | }; - LL| |} - LL| | - LL| 1|fn while_cond() { - LL| | no_merge!(); - LL| | - LL| | let mut a = 8; - LL| | while a > 0 { - ------------------ - | Branch (LL:11): [True: 8, False: 1] - ------------------ - LL| | a -= 1; - LL| | } - LL| |} - LL| | - LL| 1|fn while_cond_not() { - LL| | no_merge!(); - LL| | - LL| | let mut a = 8; - LL| | while !(a == 0) { - ------------------ - | Branch (LL:11): [True: 8, False: 1] - ------------------ - LL| | a -= 1; - LL| | } - LL| |} - LL| | - LL| 1|fn while_op_and() { - LL| | no_merge!(); - LL| | - LL| | let mut a = 8; - LL| | let mut b = 4; - LL| | while a > 0 && b > 0 { - ------------------ - | Branch (LL:11): [True: 5, False: 0] - | Branch (LL:20): [True: 4, False: 1] - ------------------ - LL| | a -= 1; - LL| | b -= 1; - LL| | } - LL| |} - LL| | - LL| 1|fn while_op_or() { - LL| | no_merge!(); - LL| | - LL| | let mut a = 4; - LL| | let mut b = 8; - LL| | while a > 0 || b > 0 { - ------------------ - | Branch (LL:11): [True: 4, False: 5] - | Branch (LL:20): [True: 4, False: 1] - ------------------ - LL| | a -= 1; - LL| | b -= 1; - LL| | } - LL| |} - LL| | - LL| |#[coverage(off)] - LL| |fn main() { - LL| | while_cond(); - LL| | while_cond_not(); - LL| | while_op_and(); - LL| | while_op_or(); - LL| |} - diff --git a/tests/coverage/branch/no-mir-spans.rs b/tests/coverage/branch/no-mir-spans.rs deleted file mode 100644 index acb268f2d45..00000000000 --- a/tests/coverage/branch/no-mir-spans.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![feature(coverage_attribute)] -//@ edition: 2021 -//@ compile-flags: -Zcoverage-options=branch,no-mir-spans -//@ llvm-cov-flags: --show-branches=count - -// Tests the behaviour of the `-Zcoverage-options=no-mir-spans` debugging flag. -// The actual code below is just some non-trivial code copied from another test -// (`while.rs`), and has no particular significance. - -macro_rules! no_merge { - () => { - for _ in 0..1 {} - }; -} - -fn while_cond() { - no_merge!(); - - let mut a = 8; - while a > 0 { - a -= 1; - } -} - -fn while_cond_not() { - no_merge!(); - - let mut a = 8; - while !(a == 0) { - a -= 1; - } -} - -fn while_op_and() { - no_merge!(); - - let mut a = 8; - let mut b = 4; - while a > 0 && b > 0 { - a -= 1; - b -= 1; - } -} - -fn while_op_or() { - no_merge!(); - - let mut a = 4; - let mut b = 8; - while a > 0 || b > 0 { - a -= 1; - b -= 1; - } -} - -#[coverage(off)] -fn main() { - while_cond(); - while_cond_not(); - while_op_and(); - while_op_or(); -} diff --git a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir index ab3925dae1c..feec68d3b0d 100644 --- a/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir +++ b/tests/mir-opt/building/custom/terminators.tail_call.built.after.mir @@ -6,6 +6,6 @@ fn tail_call(_1: i32) -> i32 { bb0: { _2 = Add(copy _1, const 42_i32); - tailcall ident::<i32>(Spanned { node: copy _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) }); + tailcall ident::<i32>(copy _2); } } diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff index a8c57d2cfe0..4fba0032729 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff @@ -93,7 +93,7 @@ } bb11: { - tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) }); + tailcall g_with_arg(move _10, move _11); } bb12 (cleanup): { diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff index a8c57d2cfe0..4fba0032729 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff +++ b/tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff @@ -93,7 +93,7 @@ } bb11: { - tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) }); + tailcall g_with_arg(move _10, move _11); } bb12 (cleanup): { diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-abort.mir b/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-abort.mir index f89b98a3205..9ec358ec189 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-abort.mir +++ b/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-abort.mir @@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () { } bb11: { - tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) }); + tailcall g_with_arg(move _10, move _11); } bb12: { diff --git a/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-unwind.mir b/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-unwind.mir index f89b98a3205..9ec358ec189 100644 --- a/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-unwind.mir +++ b/tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-unwind.mir @@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () { } bb11: { - tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) }); + tailcall g_with_arg(move _10, move _11); } bb12: { diff --git a/tests/ui/issues/issue-26095.rs b/tests/ui/associated-consts/constant-trait-item-reference-selection-26095.rs index 34c617dc495..f0fe2db432b 100644 --- a/tests/ui/issues/issue-26095.rs +++ b/tests/ui/associated-consts/constant-trait-item-reference-selection-26095.rs @@ -1,8 +1,8 @@ +// https://github.com/rust-lang/rust/issues/26095 //@ check-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] - trait HasNumber<T> { const Number: usize; } diff --git a/tests/ui/issues/issue-54044.rs b/tests/ui/attributes/cold-attribute-application-54044.rs index 809ea7a87db..2e644b91c07 100644 --- a/tests/ui/issues/issue-54044.rs +++ b/tests/ui/attributes/cold-attribute-application-54044.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/54044 #![deny(unused_attributes)] //~ NOTE lint level is defined here #[cold] diff --git a/tests/ui/issues/issue-54044.stderr b/tests/ui/attributes/cold-attribute-application-54044.stderr index 8bd94a041d0..efdf5e0de52 100644 --- a/tests/ui/issues/issue-54044.stderr +++ b/tests/ui/attributes/cold-attribute-application-54044.stderr @@ -1,5 +1,5 @@ error: attribute should be applied to a function definition - --> $DIR/issue-54044.rs:3:1 + --> $DIR/cold-attribute-application-54044.rs:4:1 | LL | #[cold] | ^^^^^^^ @@ -9,13 +9,13 @@ LL | struct Foo; | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! note: the lint level is defined here - --> $DIR/issue-54044.rs:1:9 + --> $DIR/cold-attribute-application-54044.rs:2:9 | LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ error: attribute should be applied to a function definition - --> $DIR/issue-54044.rs:9:5 + --> $DIR/cold-attribute-application-54044.rs:10:5 | LL | #[cold] | ^^^^^^^ diff --git a/tests/ui/issues/issue-36786-resolve-call.rs b/tests/ui/autoref-autoderef/autoderef-vec-box-fn-36786.rs index de7b0e18d52..e16929bf48a 100644 --- a/tests/ui/issues/issue-36786-resolve-call.rs +++ b/tests/ui/autoref-autoderef/autoderef-vec-box-fn-36786.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/36786 //@ run-pass // Ensure that types that rely on obligations are autoderefed // correctly diff --git a/tests/ui/issues/issue-46471-1.rs b/tests/ui/borrowck/borrow-checker-lifetime-error-46471.rs index aa161d40f70..020b02aa34d 100644 --- a/tests/ui/issues/issue-46471-1.rs +++ b/tests/ui/borrowck/borrow-checker-lifetime-error-46471.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/46471 fn main() { let y = { let mut z = 0; diff --git a/tests/ui/issues/issue-46471-1.stderr b/tests/ui/borrowck/borrow-checker-lifetime-error-46471.stderr index d4517223982..c90da551620 100644 --- a/tests/ui/issues/issue-46471-1.stderr +++ b/tests/ui/borrowck/borrow-checker-lifetime-error-46471.stderr @@ -1,5 +1,5 @@ error[E0597]: `z` does not live long enough - --> $DIR/issue-46471-1.rs:4:9 + --> $DIR/borrow-checker-lifetime-error-46471.rs:5:9 | LL | let mut z = 0; | ----- binding `z` declared here diff --git a/tests/ui/borrowck/string-borrowing-pattern-matching-11869.rs b/tests/ui/borrowck/string-borrowing-pattern-matching-11869.rs new file mode 100644 index 00000000000..fe3d1bf6e8a --- /dev/null +++ b/tests/ui/borrowck/string-borrowing-pattern-matching-11869.rs @@ -0,0 +1,17 @@ +// https://github.com/rust-lang/rust/issues/11869 +//@ check-pass +#![allow(dead_code)] + +struct A { + a: String +} + +fn borrow<'a>(binding: &'a A) -> &'a str { + match &*binding.a { + "in" => "in_", + "ref" => "ref_", + ident => ident + } +} + +fn main() {} diff --git a/tests/ui/issues/issue-9918.rs b/tests/ui/cast/u8-to-char-cast-9918.rs index 017e833aefb..2b8be1f0fc9 100644 --- a/tests/ui/issues/issue-9918.rs +++ b/tests/ui/cast/u8-to-char-cast-9918.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/9918 //@ run-pass pub fn main() { diff --git a/tests/ui/issues/issue-36023.rs b/tests/ui/codegen/llvm-miscompile-metadata-invalidation-36023.rs index 32e8af65c7d..efa31a51881 100644 --- a/tests/ui/issues/issue-36023.rs +++ b/tests/ui/codegen/llvm-miscompile-metadata-invalidation-36023.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/36023 //@ run-pass #![allow(unused_variables)] use std::ops::Deref; diff --git a/tests/ui/issues/issue-18058.rs b/tests/ui/coherence/impl-coherence-error-for-undefined-type-18058.rs index cced66717e1..52baf9871c3 100644 --- a/tests/ui/issues/issue-18058.rs +++ b/tests/ui/coherence/impl-coherence-error-for-undefined-type-18058.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/18058 impl Undefined {} //~^ ERROR cannot find type `Undefined` in this scope diff --git a/tests/ui/issues/issue-18058.stderr b/tests/ui/coherence/impl-coherence-error-for-undefined-type-18058.stderr index c880bb00291..07dce0b04fd 100644 --- a/tests/ui/issues/issue-18058.stderr +++ b/tests/ui/coherence/impl-coherence-error-for-undefined-type-18058.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `Undefined` in this scope - --> $DIR/issue-18058.rs:1:6 + --> $DIR/impl-coherence-error-for-undefined-type-18058.rs:2:6 | LL | impl Undefined {} | ^^^^^^^^^ not found in this scope diff --git a/tests/ui/issues/issue-77919.rs b/tests/ui/const-generics/trait-resolution-error-with-const-generics-77919.rs index bf603314977..5ab443422df 100644 --- a/tests/ui/issues/issue-77919.rs +++ b/tests/ui/const-generics/trait-resolution-error-with-const-generics-77919.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/77919 fn main() { [1; <Multiply<Five, Five>>::VAL]; } diff --git a/tests/ui/issues/issue-77919.stderr b/tests/ui/const-generics/trait-resolution-error-with-const-generics-77919.stderr index dbbe70ff069..bac8abf46dc 100644 --- a/tests/ui/issues/issue-77919.stderr +++ b/tests/ui/const-generics/trait-resolution-error-with-const-generics-77919.stderr @@ -1,5 +1,5 @@ error[E0412]: cannot find type `PhantomData` in this scope - --> $DIR/issue-77919.rs:9:9 + --> $DIR/trait-resolution-error-with-const-generics-77919.rs:10:9 | LL | _n: PhantomData, | ^^^^^^^^^^^ not found in this scope @@ -10,7 +10,7 @@ LL + use std::marker::PhantomData; | error[E0412]: cannot find type `VAL` in this scope - --> $DIR/issue-77919.rs:11:63 + --> $DIR/trait-resolution-error-with-const-generics-77919.rs:12:63 | LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | ^^^ not found in this scope @@ -21,7 +21,7 @@ LL | impl<N, M, VAL> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {} | +++++ error[E0046]: not all trait items implemented, missing: `VAL` - --> $DIR/issue-77919.rs:11:1 + --> $DIR/trait-resolution-error-with-const-generics-77919.rs:12:1 | LL | const VAL: T; | ------------ `VAL` from trait diff --git a/tests/ui/issues/issue-4734.rs b/tests/ui/drop/destructor-run-for-expression-4734.rs index 58aa0179693..57971ee5ef7 100644 --- a/tests/ui/issues/issue-4734.rs +++ b/tests/ui/drop/destructor-run-for-expression-4734.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/4734 //@ run-pass #![allow(dead_code)] // Ensures that destructors are run for expressions of the form "e;" where diff --git a/tests/ui/explicit-tail-calls/callee_is_ref.fixed b/tests/ui/explicit-tail-calls/callee_is_ref.fixed new file mode 100644 index 00000000000..7525e5c5df8 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_ref.fixed @@ -0,0 +1,26 @@ +//@ run-rustfix +#![feature(explicit_tail_calls)] +#![expect(incomplete_features)] + +fn f() {} + +fn g() { + become (*(&f))() //~ error: tail calls can only be performed with function definitions or pointers +} + +fn h() { + let table = [f as fn()]; + if let Some(fun) = table.get(0) { + become (*fun)(); //~ error: tail calls can only be performed with function definitions or pointers + } +} + +fn i() { + become (***Box::new(&mut &f))(); //~ error: tail calls can only be performed with function definitions or pointers +} + +fn main() { + g(); + h(); + i(); +} diff --git a/tests/ui/explicit-tail-calls/callee_is_ref.rs b/tests/ui/explicit-tail-calls/callee_is_ref.rs new file mode 100644 index 00000000000..36bf9efb952 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_ref.rs @@ -0,0 +1,26 @@ +//@ run-rustfix +#![feature(explicit_tail_calls)] +#![expect(incomplete_features)] + +fn f() {} + +fn g() { + become (&f)() //~ error: tail calls can only be performed with function definitions or pointers +} + +fn h() { + let table = [f as fn()]; + if let Some(fun) = table.get(0) { + become fun(); //~ error: tail calls can only be performed with function definitions or pointers + } +} + +fn i() { + become Box::new(&mut &f)(); //~ error: tail calls can only be performed with function definitions or pointers +} + +fn main() { + g(); + h(); + i(); +} diff --git a/tests/ui/explicit-tail-calls/callee_is_ref.stderr b/tests/ui/explicit-tail-calls/callee_is_ref.stderr new file mode 100644 index 00000000000..4a2ff465e68 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_ref.stderr @@ -0,0 +1,38 @@ +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_ref.rs:8:12 + | +LL | become (&f)() + | ^^^^^^ + | + = note: callee has type `&fn() {f}` +help: consider dereferencing the expression to get a function definition + | +LL | become (*(&f))() + | ++ + + +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_ref.rs:14:16 + | +LL | become fun(); + | ^^^^^ + | + = note: callee has type `&fn()` +help: consider dereferencing the expression to get a function pointer + | +LL | become (*fun)(); + | ++ + + +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_ref.rs:19:12 + | +LL | become Box::new(&mut &f)(); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: callee has type `Box<&mut &fn() {f}>` +help: consider dereferencing the expression to get a function definition + | +LL | become (***Box::new(&mut &f))(); + | ++++ + + +error: aborting due to 3 previous errors + diff --git a/tests/ui/explicit-tail-calls/callee_is_weird.rs b/tests/ui/explicit-tail-calls/callee_is_weird.rs new file mode 100644 index 00000000000..b3ca878c232 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_weird.rs @@ -0,0 +1,29 @@ +#![feature(explicit_tail_calls, exclusive_wrapper, fn_traits, unboxed_closures)] +#![expect(incomplete_features)] + +fn f() {} + +fn g() { + become std::sync::Exclusive::new(f)() //~ error: tail calls can only be performed with function definitions or pointers +} + +fn h() { + become (&mut &std::sync::Exclusive::new(f))() //~ error: tail calls can only be performed with function definitions or pointers +} + +fn i() { + struct J; + + impl FnOnce<()> for J { + type Output = (); + extern "rust-call" fn call_once(self, (): ()) -> Self::Output {} + } + + become J(); //~ error: tail calls can only be performed with function definitions or pointers +} + +fn main() { + g(); + h(); + i(); +} diff --git a/tests/ui/explicit-tail-calls/callee_is_weird.stderr b/tests/ui/explicit-tail-calls/callee_is_weird.stderr new file mode 100644 index 00000000000..a4e5a38ce33 --- /dev/null +++ b/tests/ui/explicit-tail-calls/callee_is_weird.stderr @@ -0,0 +1,26 @@ +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_weird.rs:7:12 + | +LL | become std::sync::Exclusive::new(f)() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: callee has type `Exclusive<fn() {f}>` + +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_weird.rs:11:12 + | +LL | become (&mut &std::sync::Exclusive::new(f))() + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: callee has type `Exclusive<fn() {f}>` + +error: tail calls can only be performed with function definitions or pointers + --> $DIR/callee_is_weird.rs:22:12 + | +LL | become J(); + | ^^^ + | + = note: callee has type `J` + +error: aborting due to 3 previous errors + diff --git a/tests/ui/issues/issue-36116.rs b/tests/ui/generics/unnecessary-path-disambiguator-36116.rs index 2313e189aff..c2dab605f59 100644 --- a/tests/ui/issues/issue-36116.rs +++ b/tests/ui/generics/unnecessary-path-disambiguator-36116.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/36116 // Unnecessary path disambiguator is ok //@ check-pass diff --git a/tests/ui/inference/collection-type-copy-behavior-12909.rs b/tests/ui/inference/collection-type-copy-behavior-12909.rs new file mode 100644 index 00000000000..83536e8875c --- /dev/null +++ b/tests/ui/inference/collection-type-copy-behavior-12909.rs @@ -0,0 +1,20 @@ +// https://github.com/rust-lang/rust/issues/12909 +//@ run-pass +#![allow(unused_variables)] + +use std::collections::HashMap; + +fn copy<T: Copy>(&x: &T) -> T { + x +} + +fn main() { + let arr = [(1, 1), (2, 2), (3, 3)]; + + let v1: Vec<&_> = arr.iter().collect(); + let v2: Vec<_> = arr.iter().map(copy).collect(); + + let m1: HashMap<_, _> = arr.iter().map(copy).collect(); + let m2: HashMap<isize, _> = arr.iter().map(copy).collect(); + let m3: HashMap<_, usize> = arr.iter().map(copy).collect(); +} diff --git a/tests/ui/instrument-coverage/coverage-options.bad.stderr b/tests/ui/instrument-coverage/coverage-options.bad.stderr index 1a6b30dc832..4a272cf97fb 100644 --- a/tests/ui/instrument-coverage/coverage-options.bad.stderr +++ b/tests/ui/instrument-coverage/coverage-options.bad.stderr @@ -1,2 +1,2 @@ -error: incorrect value `bad` for unstable option `coverage-options` - `block` | `branch` | `condition` | `mcdc` | `no-mir-spans` was expected +error: incorrect value `bad` for unstable option `coverage-options` - `block` | `branch` | `condition` | `mcdc` was expected diff --git a/tests/ui/issues/auxiliary/issue-25185-2.rs b/tests/ui/issues/auxiliary/issue-25185-2.rs deleted file mode 100644 index 7ce3df255a3..00000000000 --- a/tests/ui/issues/auxiliary/issue-25185-2.rs +++ /dev/null @@ -1,3 +0,0 @@ -extern crate issue_25185_1; - -pub use issue_25185_1::rust_dbg_extern_identity_u32; diff --git a/tests/ui/issues/issue-25185.rs b/tests/ui/issues/issue-25185.rs deleted file mode 100644 index 7dc06ad96df..00000000000 --- a/tests/ui/issues/issue-25185.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ run-pass -//@ aux-build:issue-25185-1.rs -//@ aux-build:issue-25185-2.rs - -extern crate issue_25185_2; - -fn main() { - let x = unsafe { - issue_25185_2::rust_dbg_extern_identity_u32(1) - }; - assert_eq!(x, 1); -} diff --git a/tests/ui/issues/issue-32655.rs b/tests/ui/issues/issue-32655.rs deleted file mode 100644 index f52e0923129..00000000000 --- a/tests/ui/issues/issue-32655.rs +++ /dev/null @@ -1,19 +0,0 @@ -macro_rules! foo ( - () => ( - #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope - struct T; - ); -); - -macro_rules! bar ( - ($e:item) => ($e) -); - -foo!(); - -bar!( - #[derive_Clone] //~ ERROR cannot find attribute `derive_Clone` in this scope - struct S; -); - -fn main() {} diff --git a/tests/ui/issues/issue-32655.stderr b/tests/ui/issues/issue-32655.stderr deleted file mode 100644 index b8362499b2d..00000000000 --- a/tests/ui/issues/issue-32655.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: cannot find attribute `derive_Clone` in this scope - --> $DIR/issue-32655.rs:3:11 - | -LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` -... -LL | foo!(); - | ------ in this macro invocation - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | - = note: similarly named attribute macro `derive_const` defined here - | - = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: cannot find attribute `derive_Clone` in this scope - --> $DIR/issue-32655.rs:15:7 - | -LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` - --> $SRC_DIR/core/src/macros/mod.rs:LL:COL - | - = note: similarly named attribute macro `derive_const` defined here - -error: aborting due to 2 previous errors - diff --git a/tests/ui/issues/issue-15673.rs b/tests/ui/iterators/iterator-type-inference-sum-15673.rs index bb61c246276..aee027927f2 100644 --- a/tests/ui/issues/issue-15673.rs +++ b/tests/ui/iterators/iterator-type-inference-sum-15673.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/15673 //@ run-pass #![allow(stable_features)] diff --git a/tests/ui/issues/auxiliary/issue-25185-1.rs b/tests/ui/linking/auxiliary/aux-25185-1.rs index 032d7d5de34..032d7d5de34 100644 --- a/tests/ui/issues/auxiliary/issue-25185-1.rs +++ b/tests/ui/linking/auxiliary/aux-25185-1.rs diff --git a/tests/ui/linking/auxiliary/aux-25185-2.rs b/tests/ui/linking/auxiliary/aux-25185-2.rs new file mode 100644 index 00000000000..96c73f623e4 --- /dev/null +++ b/tests/ui/linking/auxiliary/aux-25185-2.rs @@ -0,0 +1,3 @@ +extern crate aux_25185_1; + +pub use aux_25185_1::rust_dbg_extern_identity_u32; diff --git a/tests/ui/linking/rlib-to-dylib-native-deps-inclusion-25185.rs b/tests/ui/linking/rlib-to-dylib-native-deps-inclusion-25185.rs new file mode 100644 index 00000000000..bbcfcb75106 --- /dev/null +++ b/tests/ui/linking/rlib-to-dylib-native-deps-inclusion-25185.rs @@ -0,0 +1,13 @@ +// https://github.com/rust-lang/rust/issues/25185 +//@ run-pass +//@ aux-build:aux-25185-1.rs +//@ aux-build:aux-25185-2.rs + +extern crate aux_25185_2; + +fn main() { + let x = unsafe { + aux_25185_2::rust_dbg_extern_identity_u32(1) + }; + assert_eq!(x, 1); +} diff --git a/tests/ui/issues/issue-26093.rs b/tests/ui/macros/invalid-assignment-in-macro-26093.rs index c838515caf9..686a13a3eec 100644 --- a/tests/ui/issues/issue-26093.rs +++ b/tests/ui/macros/invalid-assignment-in-macro-26093.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/26093 macro_rules! not_a_place { ($thing:expr) => { $thing = 42; diff --git a/tests/ui/issues/issue-26093.stderr b/tests/ui/macros/invalid-assignment-in-macro-26093.stderr index 1a08d0fef41..99f188c7183 100644 --- a/tests/ui/issues/issue-26093.stderr +++ b/tests/ui/macros/invalid-assignment-in-macro-26093.stderr @@ -1,5 +1,5 @@ error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-26093.rs:3:16 + --> $DIR/invalid-assignment-in-macro-26093.rs:4:16 | LL | $thing = 42; | ^ @@ -13,7 +13,7 @@ LL | not_a_place!(99); = note: this error originates in the macro `not_a_place` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0067]: invalid left-hand side of assignment - --> $DIR/issue-26093.rs:5:16 + --> $DIR/invalid-assignment-in-macro-26093.rs:6:16 | LL | $thing += 42; | ^^ diff --git a/tests/ui/issues/issue-7519-match-unit-in-arg.rs b/tests/ui/pattern/unit-pattern-matching-in-function-argument-7519.rs index a7cea577b22..7bfa9ee6625 100644 --- a/tests/ui/issues/issue-7519-match-unit-in-arg.rs +++ b/tests/ui/pattern/unit-pattern-matching-in-function-argument-7519.rs @@ -2,6 +2,7 @@ /* #7519 ICE pattern matching unit in function argument +https://github.com/rust-lang/rust/issues/7519 */ fn foo(():()) { } diff --git a/tests/ui/threads-sendsync/tcp-stress.rs b/tests/ui/threads-sendsync/tcp-stress.rs deleted file mode 100644 index b2f76a55fb9..00000000000 --- a/tests/ui/threads-sendsync/tcp-stress.rs +++ /dev/null @@ -1,64 +0,0 @@ -//@ run-pass -//@ ignore-android needs extra network permissions -//@ needs-threads -//@ ignore-netbsd system ulimit (Too many open files) -//@ ignore-openbsd system ulimit (Too many open files) - -use std::io::prelude::*; -use std::net::{TcpListener, TcpStream}; -use std::process; -use std::sync::mpsc::channel; -use std::thread::{self, Builder}; -use std::time::Duration; - -const TARGET_CNT: usize = 200; - -fn main() { - // This test has a chance to time out, try to not let it time out - thread::spawn(move || -> () { - thread::sleep(Duration::from_secs(30)); - process::exit(1); - }); - - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); - let addr = listener.local_addr().unwrap(); - thread::spawn(move || -> () { - loop { - let mut stream = match listener.accept() { - Ok(stream) => stream.0, - Err(_) => continue, - }; - let _ = stream.read(&mut [0]); - let _ = stream.write(&[2]); - } - }); - - let (tx, rx) = channel(); - - let mut spawned_cnt = 0; - for _ in 0..TARGET_CNT { - let tx = tx.clone(); - let res = Builder::new().stack_size(64 * 1024).spawn(move || { - match TcpStream::connect(addr) { - Ok(mut stream) => { - let _ = stream.write(&[1]); - let _ = stream.read(&mut [0]); - } - Err(..) => {} - } - tx.send(()).unwrap(); - }); - if let Ok(_) = res { - spawned_cnt += 1; - }; - } - - // Wait for all clients to exit, but don't wait for the server to exit. The - // server just runs infinitely. - drop(tx); - for _ in 0..spawned_cnt { - rx.recv().unwrap(); - } - assert_eq!(spawned_cnt, TARGET_CNT); - process::exit(0); -} diff --git a/tests/ui/traits/const-traits/conditionally-const-in-anon-const.rs b/tests/ui/traits/const-traits/conditionally-const-in-anon-const.rs new file mode 100644 index 00000000000..5aebcceb7c7 --- /dev/null +++ b/tests/ui/traits/const-traits/conditionally-const-in-anon-const.rs @@ -0,0 +1,28 @@ +#![feature(const_trait_impl, impl_trait_in_bindings)] + +struct S; +#[const_trait] +trait Trait<const N: u32> {} + +impl const Trait<0> for () {} + +const fn f< + T: Trait< + { + const fn g<U: [const] Trait<0>>() {} + + struct I<U: [const] Trait<0>>(U); + //~^ ERROR `[const]` is not allowed here + + let x: &impl [const] Trait<0> = &(); + //~^ ERROR `[const]` is not allowed here + + 0 + }, + >, +>(x: &T) { + // Should be allowed here + let y: &impl [const] Trait<0> = x; +} + +pub fn main() {} diff --git a/tests/ui/traits/const-traits/conditionally-const-in-anon-const.stderr b/tests/ui/traits/const-traits/conditionally-const-in-anon-const.stderr new file mode 100644 index 00000000000..c6be249b95a --- /dev/null +++ b/tests/ui/traits/const-traits/conditionally-const-in-anon-const.stderr @@ -0,0 +1,32 @@ +error: `[const]` is not allowed here + --> $DIR/conditionally-const-in-anon-const.rs:14:25 + | +LL | struct I<U: [const] Trait<0>>(U); + | ^^^^^^^ + | +note: structs cannot have `[const]` trait bounds + --> $DIR/conditionally-const-in-anon-const.rs:14:13 + | +LL | struct I<U: [const] Trait<0>>(U); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: `[const]` is not allowed here + --> $DIR/conditionally-const-in-anon-const.rs:17:26 + | +LL | let x: &impl [const] Trait<0> = &(); + | ^^^^^^^ + | +note: anonymous constants cannot have `[const]` trait bounds + --> $DIR/conditionally-const-in-anon-const.rs:11:9 + | +LL | / { +LL | | const fn g<U: [const] Trait<0>>() {} +LL | | +LL | | struct I<U: [const] Trait<0>>(U); +... | +LL | | 0 +LL | | }, + | |_________^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/traits/const-traits/conditionally-const-in-struct-args.rs b/tests/ui/traits/const-traits/conditionally-const-in-struct-args.rs deleted file mode 100644 index 0c644694585..00000000000 --- a/tests/ui/traits/const-traits/conditionally-const-in-struct-args.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ compile-flags: -Znext-solver -//@ known-bug: #132067 -//@ check-pass - -#![feature(const_trait_impl)] - -struct S; -#[const_trait] -trait Trait<const N: u32> {} - -const fn f< - T: Trait< - { - struct I<U: [const] Trait<0>>(U); - 0 - }, - >, ->() { -} - -pub fn main() {} diff --git a/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr b/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr index 010b1584643..5c3bb236967 100644 --- a/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr +++ b/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr @@ -16,7 +16,11 @@ error: `[const]` is not allowed here LL | struct Struct<T: [const] Trait> { field: T } | ^^^^^^^ | - = note: this item cannot have `[const]` trait bounds +note: structs cannot have `[const]` trait bounds + --> $DIR/conditionally-const-invalid-places.rs:9:1 + | +LL | struct Struct<T: [const] Trait> { field: T } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here --> $DIR/conditionally-const-invalid-places.rs:10:23 @@ -24,7 +28,11 @@ error: `[const]` is not allowed here LL | struct TupleStruct<T: [const] Trait>(T); | ^^^^^^^ | - = note: this item cannot have `[const]` trait bounds +note: structs cannot have `[const]` trait bounds + --> $DIR/conditionally-const-invalid-places.rs:10:1 + | +LL | struct TupleStruct<T: [const] Trait>(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here --> $DIR/conditionally-const-invalid-places.rs:11:22 @@ -32,7 +40,11 @@ error: `[const]` is not allowed here LL | struct UnitStruct<T: [const] Trait>; | ^^^^^^^ | - = note: this item cannot have `[const]` trait bounds +note: structs cannot have `[const]` trait bounds + --> $DIR/conditionally-const-invalid-places.rs:11:1 + | +LL | struct UnitStruct<T: [const] Trait>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here --> $DIR/conditionally-const-invalid-places.rs:14:14 @@ -40,7 +52,11 @@ error: `[const]` is not allowed here LL | enum Enum<T: [const] Trait> { Variant(T) } | ^^^^^^^ | - = note: this item cannot have `[const]` trait bounds +note: enums cannot have `[const]` trait bounds + --> $DIR/conditionally-const-invalid-places.rs:14:1 + | +LL | enum Enum<T: [const] Trait> { Variant(T) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here --> $DIR/conditionally-const-invalid-places.rs:16:16 @@ -48,7 +64,11 @@ error: `[const]` is not allowed here LL | union Union<T: [const] Trait> { field: T } | ^^^^^^^ | - = note: this item cannot have `[const]` trait bounds +note: unions cannot have `[const]` trait bounds + --> $DIR/conditionally-const-invalid-places.rs:16:1 + | +LL | union Union<T: [const] Trait> { field: T } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here --> $DIR/conditionally-const-invalid-places.rs:19:14 diff --git a/tests/ui/issues/issue-22434.rs b/tests/ui/type-alias/missing-associated-type-in-trait-object-22434.rs index d9f7b987c64..35b30374c15 100644 --- a/tests/ui/issues/issue-22434.rs +++ b/tests/ui/type-alias/missing-associated-type-in-trait-object-22434.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/22434 pub trait Foo { type A; } diff --git a/tests/ui/issues/issue-22434.stderr b/tests/ui/type-alias/missing-associated-type-in-trait-object-22434.stderr index 172ae386c3e..73afefa5a1f 100644 --- a/tests/ui/issues/issue-22434.stderr +++ b/tests/ui/type-alias/missing-associated-type-in-trait-object-22434.stderr @@ -1,5 +1,5 @@ error[E0191]: the value of the associated type `A` in `Foo` must be specified - --> $DIR/issue-22434.rs:5:23 + --> $DIR/missing-associated-type-in-trait-object-22434.rs:6:23 | LL | type A; | ------ `A` defined here diff --git a/tests/ui/issues/issue-48276.rs b/tests/ui/typeck/incorrect-self-type-in-trait-impl-48276.rs index f55c056fa67..1cff2078755 100644 --- a/tests/ui/issues/issue-48276.rs +++ b/tests/ui/typeck/incorrect-self-type-in-trait-impl-48276.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/48276 // Regression test for issue #48276 - ICE when self type does not match what is // required by a trait and regions are involved. diff --git a/tests/ui/issues/issue-48276.stderr b/tests/ui/typeck/incorrect-self-type-in-trait-impl-48276.stderr index 370905ee0df..124dc459237 100644 --- a/tests/ui/issues/issue-48276.stderr +++ b/tests/ui/typeck/incorrect-self-type-in-trait-impl-48276.stderr @@ -1,5 +1,5 @@ error[E0185]: method `from` has a `&self` declaration in the impl, but not in the trait - --> $DIR/issue-48276.rs:11:5 + --> $DIR/incorrect-self-type-in-trait-impl-48276.rs:12:5 | LL | fn from(a: A) -> Self; | ---------------------- trait method declared without `&self` @@ -8,7 +8,7 @@ LL | fn from(self: &'a Self) -> &'b str { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl error[E0185]: method `from` has a `&self` declaration in the impl, but not in the trait - --> $DIR/issue-48276.rs:20:5 + --> $DIR/incorrect-self-type-in-trait-impl-48276.rs:21:5 | LL | fn from(&self) -> B { | ^^^^^^^^^^^^^^^^^^^ `&self` used in impl @@ -16,7 +16,7 @@ LL | fn from(&self) -> B { = note: `from` from trait: `fn(T) -> Self` error[E0185]: method `from` has a `&self` declaration in the impl, but not in the trait - --> $DIR/issue-48276.rs:27:5 + --> $DIR/incorrect-self-type-in-trait-impl-48276.rs:28:5 | LL | fn from(&self) -> &'static str { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl diff --git a/tests/ui/issues/issue-32995-2.rs b/tests/ui/typeck/parenthesized-type-parameters-error-32995.rs index e713a64d3f5..e0c2ab5f303 100644 --- a/tests/ui/issues/issue-32995-2.rs +++ b/tests/ui/typeck/parenthesized-type-parameters-error-32995.rs @@ -1,3 +1,4 @@ +// https://github.com/rust-lang/rust/issues/32995 fn main() { { fn f<X: ::std::marker()::Send>() {} } //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait diff --git a/tests/ui/issues/issue-32995-2.stderr b/tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr index 6c2d772a233..590cdcdb43b 100644 --- a/tests/ui/issues/issue-32995-2.stderr +++ b/tests/ui/typeck/parenthesized-type-parameters-error-32995.stderr @@ -1,17 +1,17 @@ error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995-2.rs:2:22 + --> $DIR/parenthesized-type-parameters-error-32995.rs:3:22 | LL | { fn f<X: ::std::marker()::Send>() {} } | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995-2.rs:5:29 + --> $DIR/parenthesized-type-parameters-error-32995.rs:6:29 | LL | { fn f() -> impl ::std::marker()::Send { } } | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/issue-32995-2.rs:12:13 + --> $DIR/parenthesized-type-parameters-error-32995.rs:13:13 | LL | impl ::std::marker()::Copy for X {} | ^^^^^^^^ only `Fn` traits may use parentheses diff --git a/tests/ui/issues/issue-18685.rs b/tests/ui/unboxed-closures/self-param-space-conflict-in-unboxed-closure-18685.rs index 3dab341f615..38cf26c2777 100644 --- a/tests/ui/issues/issue-18685.rs +++ b/tests/ui/unboxed-closures/self-param-space-conflict-in-unboxed-closure-18685.rs @@ -1,8 +1,8 @@ +// https://github.com/rust-lang/rust/issues/18685 //@ run-pass // Test that the self param space is not used in a conflicting // manner by unboxed closures within a default method on a trait - trait Tr { fn foo(&self); |
