Skip to content

Commit f805144

Browse files
committed
Auto merge of rust-lang#39712 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests - Successful merges: rust-lang#39587, rust-lang#39674, rust-lang#39693, rust-lang#39700, rust-lang#39705, rust-lang#39707 - Failed merges:
2 parents 24a70eb + 84ad515 commit f805144

File tree

15 files changed

+101
-78
lines changed

15 files changed

+101
-78
lines changed

src/bootstrap/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ struct Build {
150150
python: Option<String>,
151151
full_bootstrap: Option<bool>,
152152
extended: Option<bool>,
153+
verbose: Option<usize>,
153154
sanitizers: Option<bool>,
154155
}
155156

@@ -296,6 +297,7 @@ impl Config {
296297
set(&mut config.vendor, build.vendor);
297298
set(&mut config.full_bootstrap, build.full_bootstrap);
298299
set(&mut config.extended, build.extended);
300+
set(&mut config.verbose, build.verbose);
299301
set(&mut config.sanitizers, build.sanitizers);
300302

301303
if let Some(ref install) = toml.install {

src/bootstrap/config.toml.example

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@
124124
# disabled by default.
125125
#extended = false
126126

127+
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
128+
#verbose = 0
129+
127130
# Build the sanitizer runtimes
128131
#sanitizers = false
129132

src/libcore/fmt/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<'a> Display for Arguments<'a> {
434434
pub trait Debug {
435435
/// Formats the value using the given formatter.
436436
#[stable(feature = "rust1", since = "1.0.0")]
437-
fn fmt(&self, &mut Formatter) -> Result;
437+
fn fmt(&self, f: &mut Formatter) -> Result;
438438
}
439439

440440
/// Format trait for an empty format, `{}`.
@@ -477,7 +477,7 @@ pub trait Debug {
477477
pub trait Display {
478478
/// Formats the value using the given formatter.
479479
#[stable(feature = "rust1", since = "1.0.0")]
480-
fn fmt(&self, &mut Formatter) -> Result;
480+
fn fmt(&self, f: &mut Formatter) -> Result;
481481
}
482482

483483
/// Format trait for the `o` character.
@@ -524,7 +524,7 @@ pub trait Display {
524524
pub trait Octal {
525525
/// Formats the value using the given formatter.
526526
#[stable(feature = "rust1", since = "1.0.0")]
527-
fn fmt(&self, &mut Formatter) -> Result;
527+
fn fmt(&self, f: &mut Formatter) -> Result;
528528
}
529529

530530
/// Format trait for the `b` character.
@@ -571,7 +571,7 @@ pub trait Octal {
571571
pub trait Binary {
572572
/// Formats the value using the given formatter.
573573
#[stable(feature = "rust1", since = "1.0.0")]
574-
fn fmt(&self, &mut Formatter) -> Result;
574+
fn fmt(&self, f: &mut Formatter) -> Result;
575575
}
576576

577577
/// Format trait for the `x` character.
@@ -619,7 +619,7 @@ pub trait Binary {
619619
pub trait LowerHex {
620620
/// Formats the value using the given formatter.
621621
#[stable(feature = "rust1", since = "1.0.0")]
622-
fn fmt(&self, &mut Formatter) -> Result;
622+
fn fmt(&self, f: &mut Formatter) -> Result;
623623
}
624624

625625
/// Format trait for the `X` character.
@@ -667,7 +667,7 @@ pub trait LowerHex {
667667
pub trait UpperHex {
668668
/// Formats the value using the given formatter.
669669
#[stable(feature = "rust1", since = "1.0.0")]
670-
fn fmt(&self, &mut Formatter) -> Result;
670+
fn fmt(&self, f: &mut Formatter) -> Result;
671671
}
672672

673673
/// Format trait for the `p` character.
@@ -712,7 +712,7 @@ pub trait UpperHex {
712712
pub trait Pointer {
713713
/// Formats the value using the given formatter.
714714
#[stable(feature = "rust1", since = "1.0.0")]
715-
fn fmt(&self, &mut Formatter) -> Result;
715+
fn fmt(&self, f: &mut Formatter) -> Result;
716716
}
717717

718718
/// Format trait for the `e` character.
@@ -755,7 +755,7 @@ pub trait Pointer {
755755
pub trait LowerExp {
756756
/// Formats the value using the given formatter.
757757
#[stable(feature = "rust1", since = "1.0.0")]
758-
fn fmt(&self, &mut Formatter) -> Result;
758+
fn fmt(&self, f: &mut Formatter) -> Result;
759759
}
760760

761761
/// Format trait for the `E` character.
@@ -798,7 +798,7 @@ pub trait LowerExp {
798798
pub trait UpperExp {
799799
/// Formats the value using the given formatter.
800800
#[stable(feature = "rust1", since = "1.0.0")]
801-
fn fmt(&self, &mut Formatter) -> Result;
801+
fn fmt(&self, f: &mut Formatter) -> Result;
802802
}
803803

804804
/// The `write` function takes an output stream, a precompiled format string,

src/libcore/ops.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ shr_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
13241324
pub trait AddAssign<Rhs=Self> {
13251325
/// The method for the `+=` operator
13261326
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1327-
fn add_assign(&mut self, Rhs);
1327+
fn add_assign(&mut self, rhs: Rhs);
13281328
}
13291329

13301330
macro_rules! add_assign_impl {
@@ -1380,7 +1380,7 @@ add_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
13801380
pub trait SubAssign<Rhs=Self> {
13811381
/// The method for the `-=` operator
13821382
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1383-
fn sub_assign(&mut self, Rhs);
1383+
fn sub_assign(&mut self, rhs: Rhs);
13841384
}
13851385

13861386
macro_rules! sub_assign_impl {
@@ -1425,7 +1425,7 @@ sub_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
14251425
pub trait MulAssign<Rhs=Self> {
14261426
/// The method for the `*=` operator
14271427
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1428-
fn mul_assign(&mut self, Rhs);
1428+
fn mul_assign(&mut self, rhs: Rhs);
14291429
}
14301430

14311431
macro_rules! mul_assign_impl {
@@ -1470,7 +1470,7 @@ mul_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
14701470
pub trait DivAssign<Rhs=Self> {
14711471
/// The method for the `/=` operator
14721472
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1473-
fn div_assign(&mut self, Rhs);
1473+
fn div_assign(&mut self, rhs: Rhs);
14741474
}
14751475

14761476
macro_rules! div_assign_impl {
@@ -1514,7 +1514,7 @@ div_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
15141514
pub trait RemAssign<Rhs=Self> {
15151515
/// The method for the `%=` operator
15161516
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1517-
fn rem_assign(&mut self, Rhs);
1517+
fn rem_assign(&mut self, rhs: Rhs);
15181518
}
15191519

15201520
macro_rules! rem_assign_impl {
@@ -1600,7 +1600,7 @@ rem_assign_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 }
16001600
pub trait BitAndAssign<Rhs=Self> {
16011601
/// The method for the `&=` operator
16021602
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1603-
fn bitand_assign(&mut self, Rhs);
1603+
fn bitand_assign(&mut self, rhs: Rhs);
16041604
}
16051605

16061606
macro_rules! bitand_assign_impl {
@@ -1644,7 +1644,7 @@ bitand_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
16441644
pub trait BitOrAssign<Rhs=Self> {
16451645
/// The method for the `|=` operator
16461646
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1647-
fn bitor_assign(&mut self, Rhs);
1647+
fn bitor_assign(&mut self, rhs: Rhs);
16481648
}
16491649

16501650
macro_rules! bitor_assign_impl {
@@ -1688,7 +1688,7 @@ bitor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
16881688
pub trait BitXorAssign<Rhs=Self> {
16891689
/// The method for the `^=` operator
16901690
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1691-
fn bitxor_assign(&mut self, Rhs);
1691+
fn bitxor_assign(&mut self, rhs: Rhs);
16921692
}
16931693

16941694
macro_rules! bitxor_assign_impl {
@@ -1732,7 +1732,7 @@ bitxor_assign_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
17321732
pub trait ShlAssign<Rhs> {
17331733
/// The method for the `<<=` operator
17341734
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1735-
fn shl_assign(&mut self, Rhs);
1735+
fn shl_assign(&mut self, rhs: Rhs);
17361736
}
17371737

17381738
macro_rules! shl_assign_impl {
@@ -1797,7 +1797,7 @@ shl_assign_impl_all! { u8 u16 u32 u64 u128 usize i8 i16 i32 i64 i128 isize }
17971797
pub trait ShrAssign<Rhs=Self> {
17981798
/// The method for the `>>=` operator
17991799
#[stable(feature = "op_assign_traits", since = "1.8.0")]
1800-
fn shr_assign(&mut self, Rhs);
1800+
fn shr_assign(&mut self, rhs: Rhs);
18011801
}
18021802

18031803
macro_rules! shr_assign_impl {

src/libcore/str/pattern.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ pub trait DoubleEndedSearcher<'a>: ReverseSearcher<'a> {}
240240

241241
#[doc(hidden)]
242242
trait CharEq {
243-
fn matches(&mut self, char) -> bool;
243+
fn matches(&mut self, c: char) -> bool;
244244
fn only_ascii(&self) -> bool;
245245
}
246246

@@ -1178,8 +1178,8 @@ impl TwoWaySearcher {
11781178
trait TwoWayStrategy {
11791179
type Output;
11801180
fn use_early_reject() -> bool;
1181-
fn rejecting(usize, usize) -> Self::Output;
1182-
fn matching(usize, usize) -> Self::Output;
1181+
fn rejecting(a: usize, b: usize) -> Self::Output;
1182+
fn matching(a: usize, b: usize) -> Self::Output;
11831183
}
11841184

11851185
/// Skip to match intervals as quickly as possible

src/librustc_driver/driver.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
10001000
}
10011001

10021002
/// Run the translation phase to LLVM, after which the AST and analysis can
1003+
/// be discarded.
10031004
pub fn phase_4_translate_to_llvm<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
10041005
analysis: ty::CrateAnalysis,
10051006
incremental_hashes_map: &IncrementalHashesMap)

src/librustc_typeck/check/op.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
212212
self.lookup_op_method(expr, ty_mut.ty, vec![rhs_ty_var],
213213
Symbol::intern(name), trait_def_id,
214214
lhs_expr).is_ok() {
215-
err.span_note(
216-
lhs_expr.span,
215+
err.note(
217216
&format!(
218-
"this is a reference of type that `{}` can be applied to, \
219-
you need to dereference this variable once for this \
217+
"this is a reference to a type that `{}` can be applied \
218+
to; you need to dereference this variable once for this \
220219
operation to work",
221220
op.node.as_str()));
222221
}
@@ -244,11 +243,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
244243
rhs_expr, rhs_ty_var, &mut err) {
245244
// This has nothing here because it means we did string
246245
// concatenation (e.g. "Hello " + "World!"). This means
247-
// we don't want the span in the else clause to be emmitted
246+
// we don't want the note in the else clause to be emitted
248247
} else {
249-
span_note!(&mut err, lhs_expr.span,
250-
"an implementation of `{}` might be missing for `{}`",
251-
missing_trait, lhs_ty);
248+
err.note(
249+
&format!("an implementation of `{}` might be missing for `{}`",
250+
missing_trait, lhs_ty));
252251
}
253252
}
254253
err.emit();
@@ -271,16 +270,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
271270
rhs_expr: &'gcx hir::Expr,
272271
rhs_ty_var: Ty<'tcx>,
273272
mut err: &mut errors::DiagnosticBuilder) -> bool {
274-
// If this function returns false it means we use it to make sure we print
275-
// out the an "implementation of span_note!" above where this function is
276-
// called and if true we don't.
273+
// If this function returns true it means a note was printed, so we don't need
274+
// to print the normal "implementation of `std::ops::Add` might be missing" note
277275
let mut is_string_addition = false;
278276
let rhs_ty = self.check_expr_coercable_to_type(rhs_expr, rhs_ty_var);
279277
if let TyRef(_, l_ty) = lhs_ty.sty {
280278
if let TyRef(_, r_ty) = rhs_ty.sty {
281279
if l_ty.ty.sty == TyStr && r_ty.ty.sty == TyStr {
282-
span_note!(&mut err, lhs_expr.span,
283-
"`+` can't be used to concatenate two `&str` strings");
280+
err.note("`+` can't be used to concatenate two `&str` strings");
284281
let codemap = self.tcx.sess.codemap();
285282
let suggestion =
286283
match (codemap.span_to_snippet(lhs_expr.span),

src/libsyntax/parse/parser.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,10 @@ impl<'a> Parser<'a> {
802802
let mut first: bool = true;
803803
let mut v = vec![];
804804
while !kets.contains(&&self.token) {
805+
match self.token {
806+
token::CloseDelim(..) | token::Eof => break,
807+
_ => {}
808+
};
805809
match sep.sep {
806810
Some(ref t) => {
807811
if first {
@@ -2608,9 +2612,12 @@ impl<'a> Parser<'a> {
26082612
return Ok((None, kleene_op));
26092613
}
26102614

2611-
let separator = self.bump_and_get();
2615+
let separator = match self.token {
2616+
token::CloseDelim(..) => None,
2617+
_ => Some(self.bump_and_get()),
2618+
};
26122619
match parse_kleene_op(self)? {
2613-
Some(zerok) => Ok((Some(separator), zerok)),
2620+
Some(zerok) => Ok((separator, zerok)),
26142621
None => return Err(self.fatal("expected `*` or `+`"))
26152622
}
26162623
}
@@ -2647,7 +2654,7 @@ impl<'a> Parser<'a> {
26472654
tts: tts,
26482655
})))
26492656
},
2650-
token::CloseDelim(_) | token::Eof => unreachable!(),
2657+
token::CloseDelim(..) | token::Eof => Ok(TokenTree::Token(self.span, token::Eof)),
26512658
token::Dollar | token::SubstNt(..) if self.quote_depth > 0 => self.parse_unquoted(),
26522659
_ => Ok(TokenTree::Token(self.span, self.bump_and_get())),
26532660
}

src/test/compile-fail/binary-op-on-double-ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn main() {
1313
let vr = v.iter().filter(|x| {
1414
x % 2 == 0
1515
//~^ ERROR binary operation `%` cannot be applied to type `&&{integer}`
16-
//~| NOTE this is a reference of type that `%` can be applied to
16+
//~| NOTE this is a reference to a type that `%` can be applied to
1717
//~| NOTE an implementation of `std::ops::Rem` might be missing for `&&{integer}`
1818
});
1919
println!("{:?}", vr);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
fn main() {
13+
const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47];
14+
const IDX: usize = 3;
15+
const VAL: i32 = ARR[IDX];
16+
const BLUB: [i32; (ARR[0] - 41) as usize] = [5]; //~ ERROR constant evaluation error
17+
}

src/test/compile-fail/issue-39388.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
macro_rules! assign {
12+
(($($a:tt)*) = ($($b:tt))*) => { //~ ERROR expected `*` or `+`
13+
$($a)* = $($b)*
14+
}
15+
}
16+
17+
fn main() {}

src/test/compile-fail/issue-39616.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn foo(a: [0; 1]) {} //~ ERROR expected type, found `0`
12+
//~| ERROR expected one of `->`, `where`, or `{`, found `]`
13+
// FIXME(jseyfried): avoid emitting the second error (preexisting)
14+
15+
fn main() {}

0 commit comments

Comments
 (0)