Skip to content

Commit 9a12971

Browse files
committed
Auto merge of #70568 - Dylan-DPC:rollup-em6vnpx, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - #70479 (avoid creating unnecessary reference in Windows Env iterator) - #70546 (Polonius: update to 0.12.1, fix more move errors false positives, update test expectations) - #70559 (fix BTreeMap test compilation with Miri) - #70567 (Fix broken link in README) Failed merges: r? @ghost
2 parents a80ec3b + aaa8aa3 commit 9a12971

File tree

10 files changed

+23
-17
lines changed

10 files changed

+23
-17
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2522,9 +2522,9 @@ checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
25222522

25232523
[[package]]
25242524
name = "polonius-engine"
2525-
version = "0.12.0"
2525+
version = "0.12.1"
25262526
source = "registry+https://github.com/rust-lang/crates.io-index"
2527-
checksum = "04d8ef65e3f89ecaec9ca7cb0e0911b4617352d4494018bcf934992f03f2024c"
2527+
checksum = "ef2558a4b464e185b36ee08a2937ebb62ea5464c38856cfb1465c97cb38db52d"
25282528
dependencies = [
25292529
"datafrog",
25302530
"log",

src/liballoc/tests/btree/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ fn test_range_1000() {
528528
#[cfg(not(miri))] // Miri is too slow
529529
let size = 1000;
530530
#[cfg(miri)]
531-
let size = MIN_INSERTS_HEIGHT_2;
531+
let size = MIN_INSERTS_HEIGHT_2 as u32;
532532
let map: BTreeMap<_, _> = (0..size).map(|i| (i, i)).collect();
533533

534534
fn test(map: &BTreeMap<u32, u32>, size: u32, min: Bound<&u32>, max: Bound<&u32>) {

src/librustc_codegen_llvm/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ that runs towards the end of the compilation process.
44

55
For more information about how codegen works, see the [rustc dev guide].
66

7-
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/codegen.html
7+
[rustc dev guide]: https://rustc-dev-guide.rust-lang.org/backend/codegen.html

src/librustc_mir/borrow_check/type_check/liveness/polonius.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl UseFactsExtractor<'_> {
4343

4444
fn insert_path_access(&mut self, path: MovePathIndex, location: Location) {
4545
debug!("UseFactsExtractor::insert_path_access({:?}, {:?})", path, location);
46-
self.path_accessed_at_base.push((path, self.location_table.start_index(location)));
46+
self.path_accessed_at_base.push((path, self.location_to_index(location)));
4747
}
4848

4949
fn place_to_mpi(&self, place: &Place<'_>) -> Option<MovePathIndex> {

src/libstd/sys/windows/os.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl Iterator for Env {
9494
if *self.cur == 0 {
9595
return None;
9696
}
97-
let p = &*self.cur as *const u16;
97+
let p = self.cur as *const u16;
9898
let mut len = 0;
9999
while *p.offset(len) != 0 {
100100
len += 1;

src/test/ui/closures/closure-expected-type/expect-region-supply-region.polonius.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of closure
22
--> $DIR/expect-region-supply-region.rs:18:9
33
|
44
LL | let mut f: Option<&u32> = None;
5-
| ----- `f` is declared here, outside of the closure body
5+
| ----- `f` declared here, outside of the closure body
66
LL | closure_expecting_bound(|x| {
77
| - `x` is a reference that is only valid in the closure body
88
LL | f = Some(x);
@@ -12,7 +12,7 @@ error[E0521]: borrowed data escapes outside of closure
1212
--> $DIR/expect-region-supply-region.rs:28:9
1313
|
1414
LL | let mut f: Option<&u32> = None;
15-
| ----- `f` is declared here, outside of the closure body
15+
| ----- `f` declared here, outside of the closure body
1616
LL | closure_expecting_bound(|x: &u32| {
1717
| - `x` is a reference that is only valid in the closure body
1818
LL | f = Some(x);
@@ -33,7 +33,7 @@ error[E0521]: borrowed data escapes outside of closure
3333
--> $DIR/expect-region-supply-region.rs:42:9
3434
|
3535
LL | let mut f: Option<&u32> = None;
36-
| ----- `f` is declared here, outside of the closure body
36+
| ----- `f` declared here, outside of the closure body
3737
...
3838
LL | closure_expecting_bound(|x: &'x u32| {
3939
| - `x` is a reference that is only valid in the closure body

src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
3939
... |
4040
LL | | foo_hrtb_bar_not(&mut t);
4141
| | ------------------------ recursive call site
42+
LL | |
4243
LL | | }
4344
| |_^ cannot return without recursing
4445
|
@@ -51,7 +52,7 @@ LL | foo_hrtb_bar_not(&mut t);
5152
| ^^^^^^^^^^^^^^^^^^^^^^^^
5253

5354
warning: function cannot return without recursing
54-
--> $DIR/hrtb-perfect-forwarding.rs:49:1
55+
--> $DIR/hrtb-perfect-forwarding.rs:50:1
5556
|
5657
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
5758
LL | | where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>

src/test/ui/impl-trait/multiple-lifetimes/error-handling.polonius.stderr

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
error: lifetime may not live long enough
2-
--> $DIR/error-handling.rs:13:56
2+
--> $DIR/error-handling.rs:23:16
33
|
44
LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
5-
| -- -- lifetime `'b` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'b`
5+
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8+
...
9+
LL | let _: &'b i32 = *u.0;
10+
| ^^^^^^^ type annotation requires that `'a` must outlive `'b`
811
|
912
= help: consider adding the following bound: `'a: 'b`
1013

src/test/ui/nll/outlives-suggestion-simple.polonius.stderr

+6-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ LL | (x, x)
7272
|
7373
= help: consider adding the following bound: `'a: 'c`
7474

75+
help: add bound `'a: 'b + 'c`
76+
7577
error: lifetime may not live long enough
7678
--> $DIR/outlives-suggestion-simple.rs:31:9
7779
|
@@ -106,16 +108,16 @@ LL | self.x
106108
|
107109
= help: consider adding the following bound: `'b: 'a`
108110

109-
error[E0521]: borrowed data escapes outside of function
111+
error[E0521]: borrowed data escapes outside of associated function
110112
--> $DIR/outlives-suggestion-simple.rs:73:9
111113
|
112114
LL | fn get_bar(&self) -> Bar2 {
113115
| -----
114116
| |
115-
| `self` is declared here, outside of the function body
116-
| `self` is a reference that is only valid in the function body
117+
| `self` declared here, outside of the associated function body
118+
| `self` is a reference that is only valid in the associated function body
117119
LL | Bar2::new(&self)
118-
| ^^^^^^^^^^^^^^^^ `self` escapes the function body here
120+
| ^^^^^^^^^^^^^^^^ `self` escapes the associated function body here
119121

120122
error: aborting due to 10 previous errors
121123

src/test/ui/nll/user-annotations/closure-substs.polonius.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ error[E0521]: borrowed data escapes outside of closure
5050
--> $DIR/closure-substs.rs:29:9
5151
|
5252
LL | |x: &i32, b: fn(&'static i32)| {
53-
| - - `b` is declared here, outside of the closure body
53+
| - - `b` declared here, outside of the closure body
5454
| |
5555
| `x` is a reference that is only valid in the closure body
5656
LL | b(x);

0 commit comments

Comments
 (0)