Skip to content

Commit 770b9e3

Browse files
committed
Auto merge of #65644 - Centril:rollup-gez1xhe, r=Centril
Rollup of 8 pull requests Successful merges: - #65314 (rustdoc: forward -Z options to rustc) - #65592 (clarify const_prop ICE protection comment) - #65603 (Avoid ICE when include! is used by stdin crate) - #65614 (Improve error message for APIT with explicit generic arguments) - #65629 (Remove `borrowck_graphviz_postflow` from test) - #65633 (Remove leading :: from paths in doc examples) - #65638 (Rename the default argument 'def' to 'default') - #65639 (Fix parameter name in documentation) Failed merges: r? @ghost
2 parents 7979016 + 836e45d commit 770b9e3

27 files changed

+124
-68
lines changed

src/libcore/iter/traits/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub trait FromIterator<A>: Sized {
167167
/// // and we'll implement IntoIterator
168168
/// impl IntoIterator for MyCollection {
169169
/// type Item = i32;
170-
/// type IntoIter = ::std::vec::IntoIter<Self::Item>;
170+
/// type IntoIter = std::vec::IntoIter<Self::Item>;
171171
///
172172
/// fn into_iter(self) -> Self::IntoIter {
173173
/// self.0.into_iter()

src/libcore/ops/unsize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
7676
/// ```
7777
/// # #![feature(dispatch_from_dyn, unsize)]
7878
/// # use std::{ops::DispatchFromDyn, marker::Unsize};
79-
/// # struct Rc<T: ?Sized>(::std::rc::Rc<T>);
79+
/// # struct Rc<T: ?Sized>(std::rc::Rc<T>);
8080
/// impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Rc<U>> for Rc<T>
8181
/// where
8282
/// T: Unsize<U>,

src/libcore/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ impl<T> Option<T> {
395395
/// ```
396396
#[inline]
397397
#[stable(feature = "rust1", since = "1.0.0")]
398-
pub fn unwrap_or(self, def: T) -> T {
398+
pub fn unwrap_or(self, default: T) -> T {
399399
match self {
400400
Some(x) => x,
401-
None => def,
401+
None => default,
402402
}
403403
}
404404

src/libcore/str/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ Section: Creating a string
176176
/// ```
177177
/// fn from_utf8_lossy<F>(mut input: &[u8], mut push: F) where F: FnMut(&str) {
178178
/// loop {
179-
/// match ::std::str::from_utf8(input) {
179+
/// match std::str::from_utf8(input) {
180180
/// Ok(valid) => {
181181
/// push(valid);
182182
/// break
183183
/// }
184184
/// Err(error) => {
185185
/// let (valid, after_valid) = input.split_at(error.valid_up_to());
186186
/// unsafe {
187-
/// push(::std::str::from_utf8_unchecked(valid))
187+
/// push(std::str::from_utf8_unchecked(valid))
188188
/// }
189189
/// push("\u{FFFD}");
190190
///

src/librustc_mir/transform/const_prop.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -518,27 +518,30 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
518518
}
519519
}
520520

521-
// Work around: avoid ICE in miri.
522-
// FIXME(wesleywiser) we don't currently handle the case where we try to make a ref
523-
// from a function argument that hasn't been assigned to in this function. The main
524-
// issue is if an arg is a fat-pointer, miri `expects()` to be able to read the value
525-
// of that pointer to get size info. However, since this is `ConstProp`, that argument
526-
// doesn't actually have a backing value and so this causes an ICE.
521+
// Work around: avoid ICE in miri. FIXME(wesleywiser)
522+
// The Miri engine ICEs when taking a reference to an uninitialized unsized
523+
// local. There's nothing it can do here: taking a reference needs an allocation
524+
// which needs to know the size. Normally that's okay as during execution
525+
// (e.g. for CTFE) it can never happen. But here in const_prop
526+
// unknown data is uninitialized, so if e.g. a function argument is unsized
527+
// and has a reference taken, we get an ICE.
527528
Rvalue::Ref(_, _, Place { base: PlaceBase::Local(local), projection: box [] }) => {
528529
trace!("checking Ref({:?})", place);
529530
let alive =
530531
if let LocalValue::Live(_) = self.ecx.frame().locals[*local].value {
531532
true
532-
} else { false };
533+
} else {
534+
false
535+
};
533536

534-
if local.as_usize() <= self.ecx.frame().body.arg_count && !alive {
535-
trace!("skipping Ref({:?})", place);
537+
if !alive {
538+
trace!("skipping Ref({:?}) to uninitialized local", place);
536539
return None;
537540
}
538541
}
539542

540-
// Work around: avoid extra unnecessary locals.
541-
// FIXME(wesleywiser): const eval will turn this into a `const Scalar(<ZST>)` that
543+
// Work around: avoid extra unnecessary locals. FIXME(wesleywiser)
544+
// Const eval will turn this into a `const Scalar(<ZST>)` that
542545
// `SimplifyLocals` doesn't know it can remove.
543546
Rvalue::Aggregate(_, operands) if operands.len() == 0 => {
544547
return None;

src/librustc_typeck/astconv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
232232
tcx.sess,
233233
span,
234234
E0632,
235-
"cannot provide explicit type parameters when `impl Trait` is \
236-
used in argument position."
235+
"cannot provide explicit generic arguments when `impl Trait` is \
236+
used in argument position"
237237
};
238238

239239
err.emit();

src/librustc_typeck/error_codes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5048,8 +5048,8 @@ the future, [RFC 2091] prohibits their implementation without a follow-up RFC.
50485048
// E0612, // merged into E0609
50495049
// E0613, // Removed (merged with E0609)
50505050
E0627, // yield statement outside of generator literal
5051-
E0632, // cannot provide explicit type parameters when `impl Trait` is used
5052-
// in argument position.
5051+
E0632, // cannot provide explicit generic arguments when `impl Trait` is
5052+
// used in argument position
50535053
E0634, // type has conflicting packed representaton hints
50545054
E0640, // infer outlives requirements
50555055
E0641, // cannot cast to/from a pointer with an unknown kind

src/librustdoc/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ pub struct Options {
5353
pub codegen_options_strs: Vec<String>,
5454
/// Debugging (`-Z`) options to pass to the compiler.
5555
pub debugging_options: DebuggingOptions,
56+
/// Debugging (`-Z`) options strings to pass to the compiler.
57+
pub debugging_options_strs: Vec<String>,
5658
/// The target used to compile the crate against.
5759
pub target: TargetTriple,
5860
/// Edition used when reading the crate. Defaults to "2015". Also used by default when
@@ -478,6 +480,7 @@ impl Options {
478480
let generate_redirect_pages = matches.opt_present("generate-redirect-pages");
479481
let test_builder = matches.opt_str("test-builder").map(PathBuf::from);
480482
let codegen_options_strs = matches.opt_strs("C");
483+
let debugging_options_strs = matches.opt_strs("Z");
481484
let lib_strs = matches.opt_strs("L");
482485
let extern_strs = matches.opt_strs("extern");
483486
let runtool = matches.opt_str("runtool");
@@ -499,6 +502,7 @@ impl Options {
499502
codegen_options,
500503
codegen_options_strs,
501504
debugging_options,
505+
debugging_options_strs,
502506
target,
503507
edition,
504508
maybe_sysroot,

src/librustdoc/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ fn run_test(
280280
for codegen_options_str in &options.codegen_options_strs {
281281
compiler.arg("-C").arg(&codegen_options_str);
282282
}
283+
for debugging_option_str in &options.debugging_options_strs {
284+
compiler.arg("-Z").arg(&debugging_option_str);
285+
}
283286
if no_run {
284287
compiler.arg("--emit=metadata");
285288
}

src/libstd/io/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ pub fn set_print(sink: Option<Box<dyn Write + Send>>) -> Option<Box<dyn Write +
762762
/// otherwise. `label` identifies the stream in a panic message.
763763
///
764764
/// This function is used to print error messages, so it takes extra
765-
/// care to avoid causing a panic when `local_stream` is unusable.
765+
/// care to avoid causing a panic when `local_s` is unusable.
766766
/// For instance, if the TLS key for the local stream is
767767
/// already destroyed, or if the local stream is locked by another
768768
/// thread, it will just fall back to the global stream.

0 commit comments

Comments
 (0)