Skip to content

Commit 764232c

Browse files
committed
Auto merge of #51805 - pietroalbini:rollup, r=pietroalbini
Rollup of 11 pull requests Successful merges: - #51104 (add `dyn ` to display of dynamic (trait) types) - #51153 (Link panic and compile_error docs) - #51642 (Fix unknown windows build) - #51730 (New safe associated functions for PinMut) - #51731 (Fix ICEs when using continue as an array length inside closures (inside loop conditions)) - #51747 (Add error for using null characters in #[export_name]) - #51769 (Update broken rustc-guide links) - #51786 (Remove unnecessary stat64 pointer casts) - #51788 (Fix typo) - #51789 (Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`) - #51791 (Minify css) Failed merges: r? @ghost
2 parents 309fd8a + a539885 commit 764232c

File tree

98 files changed

+397
-244
lines changed

Some content is hidden

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

98 files changed

+397
-244
lines changed

src/Cargo.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12201220

12211221
[[package]]
12221222
name = "minifier"
1223-
version = "0.0.11"
1223+
version = "0.0.14"
12241224
source = "registry+https://github.com/rust-lang/crates.io-index"
12251225
dependencies = [
12261226
"regex 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2426,7 +2426,7 @@ dependencies = [
24262426
name = "rustdoc"
24272427
version = "0.0.0"
24282428
dependencies = [
2429-
"minifier 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
2429+
"minifier 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
24302430
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
24312431
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
24322432
]
@@ -3263,7 +3263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32633263
"checksum mdbook 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "90b5a8d7e341ceee5db3882a06078d42661ddcfa2b3687319cc5da76ec4e782f"
32643264
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
32653265
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
3266-
"checksum minifier 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "26f3e36a4db1981b16567e4abfd6ddc3641bc9b950bdc868701f656bf9b74bdd"
3266+
"checksum minifier 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "78cb57f9a385530d60f2d67f6e108050b478b7a0ffd0bb9c350803e1356535dd"
32673267
"checksum miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "609ce024854aeb19a0ef7567d348aaa5a746b32fb72e336df7fcc16869d7e2b4"
32683268
"checksum miow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9224c91f82b3c47cf53dcf78dfaa20d6888fbcc5d272d5f2fcdf8a697f3c987d"
32693269
"checksum nibble_vec 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa"

src/libcore/mem.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,12 @@ impl<'a, T: ?Sized + Unpin> PinMut<'a, T> {
11191119
pub fn new(reference: &'a mut T) -> PinMut<'a, T> {
11201120
PinMut { inner: reference }
11211121
}
1122+
1123+
/// Get a mutable reference to the data inside of this `PinMut`.
1124+
#[unstable(feature = "pin", issue = "49150")]
1125+
pub fn get_mut(this: PinMut<'a, T>) -> &'a mut T {
1126+
this.inner
1127+
}
11221128
}
11231129

11241130

@@ -1150,21 +1156,21 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
11501156
/// the data out of the mutable reference you receive when you call this
11511157
/// function.
11521158
#[unstable(feature = "pin", issue = "49150")]
1153-
pub unsafe fn get_mut(this: PinMut<'a, T>) -> &'a mut T {
1159+
pub unsafe fn get_mut_unchecked(this: PinMut<'a, T>) -> &'a mut T {
11541160
this.inner
11551161
}
11561162

11571163
/// Construct a new pin by mapping the interior value.
11581164
///
1159-
/// For example, if you wanted to get a `PinMut` of a field of something, you
1160-
/// could use this to get access to that field in one line of code.
1165+
/// For example, if you wanted to get a `PinMut` of a field of something,
1166+
/// you could use this to get access to that field in one line of code.
11611167
///
11621168
/// This function is unsafe. You must guarantee that the data you return
11631169
/// will not move so long as the argument value does not move (for example,
11641170
/// because it is one of the fields of that value), and also that you do
11651171
/// not move out of the argument you receive to the interior function.
11661172
#[unstable(feature = "pin", issue = "49150")]
1167-
pub unsafe fn map<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where
1173+
pub unsafe fn map_unchecked<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where
11681174
F: FnOnce(&mut T) -> &mut U
11691175
{
11701176
PinMut { inner: f(this.inner) }

src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl<T> Option<T> {
275275
#[unstable(feature = "pin", issue = "49150")]
276276
pub fn as_pin_mut<'a>(self: PinMut<'a, Self>) -> Option<PinMut<'a, T>> {
277277
unsafe {
278-
PinMut::get_mut(self).as_mut().map(|x| PinMut::new_unchecked(x))
278+
PinMut::get_mut_unchecked(self).as_mut().map(|x| PinMut::new_unchecked(x))
279279
}
280280
}
281281

src/librustc/hir/lowering.rs

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,12 +3536,22 @@ impl<'a> LoweringContext<'a> {
35363536
this.expr_block(block, ThinVec::new())
35373537
})
35383538
})
3539-
},
3539+
}
35403540
ExprKind::Closure(
3541-
capture_clause, asyncness, movability, ref decl, ref body, fn_decl_span) =>
3542-
{
3543-
self.with_new_scopes(|this| {
3544-
if let IsAsync::Async(async_closure_node_id) = asyncness {
3541+
capture_clause, asyncness, movability, ref decl, ref body, fn_decl_span
3542+
) => {
3543+
if let IsAsync::Async(async_closure_node_id) = asyncness {
3544+
let outer_decl = FnDecl {
3545+
inputs: decl.inputs.clone(),
3546+
output: FunctionRetTy::Default(fn_decl_span),
3547+
variadic: false,
3548+
};
3549+
// We need to lower the declaration outside the new scope, because we
3550+
// have to conserve the state of being inside a loop condition for the
3551+
// closure argument types.
3552+
let fn_decl = self.lower_fn_decl(&outer_decl, None, false, false);
3553+
3554+
self.with_new_scopes(|this| {
35453555
// FIXME(cramertj) allow `async` non-`move` closures with
35463556
if capture_clause == CaptureBy::Ref &&
35473557
!decl.inputs.is_empty()
@@ -3561,11 +3571,6 @@ impl<'a> LoweringContext<'a> {
35613571

35623572
// Transform `async |x: u8| -> X { ... }` into
35633573
// `|x: u8| future_from_generator(|| -> X { ... })`
3564-
let outer_decl = FnDecl {
3565-
inputs: decl.inputs.clone(),
3566-
output: FunctionRetTy::Default(fn_decl_span),
3567-
variadic: false,
3568-
};
35693574
let body_id = this.lower_body(Some(&outer_decl), |this| {
35703575
let async_ret_ty = if let FunctionRetTy::Ty(ty) = &decl.output {
35713576
Some(&**ty)
@@ -3579,12 +3584,17 @@ impl<'a> LoweringContext<'a> {
35793584
});
35803585
hir::ExprClosure(
35813586
this.lower_capture_clause(capture_clause),
3582-
this.lower_fn_decl(&outer_decl, None, false, false),
3587+
fn_decl,
35833588
body_id,
35843589
fn_decl_span,
35853590
None,
35863591
)
3587-
} else {
3592+
})
3593+
} else {
3594+
// Lower outside new scope to preserve `is_in_loop_condition`.
3595+
let fn_decl = self.lower_fn_decl(decl, None, false, false);
3596+
3597+
self.with_new_scopes(|this| {
35883598
let mut is_generator = false;
35893599
let body_id = this.lower_body(Some(decl), |this| {
35903600
let e = this.lower_expr(body);
@@ -3618,13 +3628,13 @@ impl<'a> LoweringContext<'a> {
36183628
};
36193629
hir::ExprClosure(
36203630
this.lower_capture_clause(capture_clause),
3621-
this.lower_fn_decl(decl, None, false, false),
3631+
fn_decl,
36223632
body_id,
36233633
fn_decl_span,
36243634
generator_option,
36253635
)
3626-
}
3627-
})
3636+
})
3637+
}
36283638
}
36293639
ExprKind::Block(ref blk, opt_label) => {
36303640
hir::ExprBlock(self.lower_block(blk,

src/librustc/infer/canonical.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//! For a more detailed look at what is happening here, check
3030
//! out the [chapter in the rustc guide][c].
3131
//!
32-
//! [c]: https://rust-lang-nursery.github.io/rustc-guide/traits-canonicalization.html
32+
//! [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html
3333
3434
use infer::{InferCtxt, InferOk, InferResult, RegionVariableOrigin, TypeVariableOrigin};
3535
use rustc_data_structures::indexed_vec::Idx;
@@ -274,7 +274,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
274274
/// To get a good understanding of what is happening here, check
275275
/// out the [chapter in the rustc guide][c].
276276
///
277-
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits-canonicalization.html#processing-the-canonicalized-query-result
277+
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html#processing-the-canonicalized-query-result
278278
pub fn instantiate_query_result<R>(
279279
&self,
280280
cause: &ObligationCause<'tcx>,
@@ -458,7 +458,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
458458
/// To get a good understanding of what is happening here, check
459459
/// out the [chapter in the rustc guide][c].
460460
///
461-
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits-canonicalization.html#canonicalizing-the-query
461+
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html#canonicalizing-the-query
462462
pub fn canonicalize_query<V>(&self, value: &V) -> (V::Canonicalized, CanonicalVarValues<'tcx>)
463463
where
464464
V: Canonicalize<'gcx, 'tcx>,
@@ -497,7 +497,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
497497
/// To get a good understanding of what is happening here, check
498498
/// out the [chapter in the rustc guide][c].
499499
///
500-
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits-canonicalization.html#canonicalizing-the-query-result
500+
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html#canonicalizing-the-query-result
501501
pub fn canonicalize_response<V>(
502502
&self,
503503
value: &V,

src/librustc/infer/higher_ranked/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
583583
/// For more information about how skolemization for HRTBs works, see
584584
/// the [rustc guide].
585585
///
586-
/// [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/trait-hrtb.html
586+
/// [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/traits/hrtb.html
587587
pub fn skolemize_late_bound_regions<T>(&self,
588588
binder: &ty::Binder<T>)
589589
-> (T, SkolemizationMap<'tcx>)

src/librustc/infer/lexical_region_resolve/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> WARNING: This README is obsolete and will be removed soon! For
44
> more info on how the current borrowck works, see the [rustc guide].
55
6-
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir-borrowck.html
6+
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir/borrowck.html
77

88
## Terminology
99

src/librustc/infer/region_constraints/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> WARNING: This README is obsolete and will be removed soon! For
44
> more info on how the current borrowck works, see the [rustc guide].
55
6-
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir-borrowck.html
6+
[rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir/borrowck.html
77

88
## Terminology
99

src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! For more information about how MIR-based region-checking works,
1515
//! see the [rustc guide].
1616
//!
17-
//! [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir-borrowck.html
17+
//! [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir/borrowck.html
1818
1919
use ich::{StableHashingContext, NodeIdHashingMode};
2020
use util::nodemap::{FxHashMap, FxHashSet};

src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! MIR datatypes and passes. See the [rustc guide] for more info.
1212
//!
13-
//! [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir.html
13+
//! [rustc guide]: https://rust-lang-nursery.github.io/rustc-guide/mir/index.html
1414
1515
use graphviz::IntoCow;
1616
use hir::def::CtorKind;

0 commit comments

Comments
 (0)