Skip to content

Commit 2ed54fe

Browse files
committed
comments
1 parent d636a65 commit 2ed54fe

File tree

47 files changed

+112
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+112
-34
lines changed

tests/ui/block-result/blocks-without-results.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/11709
2+
13
//@ run-pass
24
#![allow(dead_code)]
35

tests/ui/borrowck/refcell-borrow-comparison.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/12033
2+
13
//@ run-pass
24
use std::cell::RefCell;
35

tests/ui/closures/fnonce-moved-twice.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/12127
2+
13
#![feature(unboxed_closures, tuple_trait)]
24

35
fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }

tests/ui/issues/issue-12127.stderr renamed to tests/ui/closures/fnonce-moved-twice.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error[E0382]: use of moved value: `f`
2-
--> $DIR/issue-12127.rs:11:9
2+
--> $DIR/fnonce-moved-twice.rs:13:9
33
|
44
LL | f();
55
| --- `f` moved due to this call
66
LL | f();
77
| ^ value used here after move
88
|
99
note: this value implements `FnOnce`, which causes it to be moved when called
10-
--> $DIR/issue-12127.rs:10:9
10+
--> $DIR/fnonce-moved-twice.rs:12:9
1111
|
1212
LL | f();
1313
| ^
14-
= note: move occurs because `f` has type `{closure@$DIR/issue-12127.rs:8:24: 8:30}`, which does not implement the `Copy` trait
14+
= note: move occurs because `f` has type `{closure@$DIR/fnonce-moved-twice.rs:10:24: 10:30}`, which does not implement the `Copy` trait
1515

1616
error: aborting due to 1 previous error
1717

tests/ui/closures/moved-upvar-mut-rebind.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/11958
2+
13
//@ run-pass
24

35
// We shouldn't need to rebind a moved upvar as mut if it's already

tests/ui/issues/issue-11958.stderr renamed to tests/ui/closures/moved-upvar-mut-rebind.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: value assigned to `x` is never read
2-
--> $DIR/issue-11958.rs:8:36
2+
--> $DIR/moved-upvar-mut-rebind.rs:10:36
33
|
44
LL | let _thunk = Box::new(move|| { x = 2; });
55
| ^
@@ -8,7 +8,7 @@ LL | let _thunk = Box::new(move|| { x = 2; });
88
= note: `#[warn(unused_assignments)]` on by default
99

1010
warning: unused variable: `x`
11-
--> $DIR/issue-11958.rs:8:36
11+
--> $DIR/moved-upvar-mut-rebind.rs:10:36
1212
|
1313
LL | let _thunk = Box::new(move|| { x = 2; });
1414
| ^

tests/ui/collections/hashset-connected-border.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/12860
2+
13
//@ run-pass
24
use std::collections::HashSet;
35

tests/ui/const-generics/vec-macro-in-static-array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/13446
2+
13
// Used to cause ICE
24

35
static VEC: [u32; 256] = vec![];

tests/ui/issues/issue-13446.stderr renamed to tests/ui/const-generics/vec-macro-in-static-array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-13446.rs:3:26
2+
--> $DIR/vec-macro-in-static-array.rs:5:26
33
|
44
LL | static VEC: [u32; 256] = vec![];
55
| ^^^^^^ expected `[u32; 256]`, found `Vec<_>`

tests/ui/extern/format-message-windows-ffi.rs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/13259
2+
13
//@ run-pass
24

35
#[cfg(windows)]
@@ -7,21 +9,29 @@ mod imp {
79
type LPWSTR = *mut u16;
810

911
extern "system" {
10-
fn FormatMessageW(flags: DWORD,
11-
lpSrc: LPVOID,
12-
msgId: DWORD,
13-
langId: DWORD,
14-
buf: LPWSTR,
15-
nsize: DWORD,
16-
args: *const u8)
17-
-> DWORD;
12+
fn FormatMessageW(
13+
flags: DWORD,
14+
lpSrc: LPVOID,
15+
msgId: DWORD,
16+
langId: DWORD,
17+
buf: LPWSTR,
18+
nsize: DWORD,
19+
args: *const u8,
20+
) -> DWORD;
1821
}
1922

2023
pub fn test() {
2124
let mut buf: [u16; 50] = [0; 50];
2225
let ret = unsafe {
23-
FormatMessageW(0x1000, core::ptr::null_mut(), 1, 0x400,
24-
buf.as_mut_ptr(), buf.len() as u32, core::ptr::null())
26+
FormatMessageW(
27+
0x1000,
28+
core::ptr::null_mut(),
29+
1,
30+
0x400,
31+
buf.as_mut_ptr(),
32+
buf.len() as u32,
33+
core::ptr::null(),
34+
)
2535
};
2636
// On some 32-bit Windowses (Win7-8 at least) this will panic with segmented
2737
// stacks taking control of pvArbitrary
@@ -31,7 +41,7 @@ mod imp {
3141

3242
#[cfg(not(windows))]
3343
mod imp {
34-
pub fn test() { }
44+
pub fn test() {}
3545
}
3646

3747
fn main() {

0 commit comments

Comments
 (0)