Skip to content

Commit a6624ed

Browse files
committed
Auto merge of #64293 - Centril:rollup-blnhxwl, r=Centril
Rollup of 4 pull requests Successful merges: - #64078 (compiletest: disable -Aunused for run-pass tests) - #64263 (Replace "feature gated" wording with "unstable".) - #64280 (Factor out pluralisation into syntax::errors) - #64288 (use 'get_toml' instead of regular expression) Failed merges: r? @ghost
2 parents 2b8116d + 51b110f commit a6624ed

File tree

77 files changed

+177
-101
lines changed

Some content is hidden

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

77 files changed

+177
-101
lines changed

src/bootstrap/bootstrap.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ def get_toml(self, key, section=None):
523523
'value2'
524524
>>> rb.get_toml('key', 'c') is None
525525
True
526+
527+
>>> rb.config_toml = 'key1 = true'
528+
>>> rb.get_toml("key1")
529+
'true'
526530
"""
527531

528532
cur_section = None
@@ -571,6 +575,12 @@ def get_string(line):
571575
572576
>>> RustBuild.get_string(' "devel" ')
573577
'devel'
578+
>>> RustBuild.get_string(" 'devel' ")
579+
'devel'
580+
>>> RustBuild.get_string('devel') is None
581+
True
582+
>>> RustBuild.get_string(' "devel ')
583+
''
574584
"""
575585
start = line.find('"')
576586
if start != -1:
@@ -822,13 +832,13 @@ def bootstrap(help_triggered):
822832
except (OSError, IOError):
823833
pass
824834

825-
match = re.search(r'\nverbose = (\d+)', build.config_toml)
826-
if match is not None:
827-
build.verbose = max(build.verbose, int(match.group(1)))
835+
config_verbose = build.get_toml('verbose', 'build')
836+
if config_verbose is not None:
837+
build.verbose = max(build.verbose, int(config_verbose))
828838

829-
build.use_vendored_sources = '\nvendor = true' in build.config_toml
839+
build.use_vendored_sources = build.get_toml('vendor', 'build') == 'true'
830840

831-
build.use_locked_deps = '\nlocked-deps = true' in build.config_toml
841+
build.use_locked_deps = build.get_toml('locked-deps', 'build') == 'true'
832842

833843
build.check_vendored_status()
834844

src/librustc/ty/error.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::borrow::Cow;
44
use std::fmt;
55
use rustc_target::spec::abi;
66
use syntax::ast;
7+
use syntax::errors::pluralise;
78
use errors::{Applicability, DiagnosticBuilder};
89
use syntax_pos::Span;
910

@@ -82,12 +83,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
8283
}
8384
};
8485

85-
macro_rules! pluralise {
86-
($x:expr) => {
87-
if $x != 1 { "s" } else { "" }
88-
};
89-
}
90-
9186
match *self {
9287
CyclicTy(_) => write!(f, "cyclic type of infinite size"),
9388
Mismatch => write!(f, "types differ"),

src/librustc_errors/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,3 +845,10 @@ impl Level {
845845
}
846846
}
847847
}
848+
849+
#[macro_export]
850+
macro_rules! pluralise {
851+
($x:expr) => {
852+
if $x != 1 { "s" } else { "" }
853+
};
854+
}

src/librustc_metadata/native_libs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ impl Collector<'tcx> {
159159
sym::link_cfg,
160160
span.unwrap(),
161161
GateIssue::Language,
162-
"is feature gated");
162+
"is unstable");
163163
}
164164
if lib.kind == cstore::NativeStaticNobundle &&
165165
!self.tcx.features().static_nobundle {
166166
feature_gate::emit_feature_err(&self.tcx.sess.parse_sess,
167167
sym::static_nobundle,
168168
span.unwrap_or_else(|| syntax_pos::DUMMY_SP),
169169
GateIssue::Language,
170-
"kind=\"static-nobundle\" is feature gated");
170+
"kind=\"static-nobundle\" is unstable");
171171
}
172172
self.libs.push(lib);
173173
}

src/librustc_typeck/astconv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use rustc_target::spec::abi;
2323
use crate::require_c_abi_if_c_variadic;
2424
use smallvec::SmallVec;
2525
use syntax::ast;
26+
use syntax::errors::pluralise;
2627
use syntax::feature_gate::{GateIssue, emit_feature_err};
2728
use syntax::util::lev_distance::find_best_match_for_name;
2829
use syntax::symbol::sym;
@@ -377,7 +378,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
377378
quantifier,
378379
bound,
379380
kind,
380-
if bound != 1 { "s" } else { "" },
381+
pluralise!(bound),
381382
))
382383
};
383384

src/librustc_typeck/check/compare_method.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc::util::common::ErrorReported;
1010
use errors::{Applicability, DiagnosticId};
1111

1212
use syntax_pos::Span;
13+
use syntax::errors::pluralise;
1314

1415
use super::{Inherited, FnCtxt, potentially_plural_count};
1516

@@ -648,9 +649,9 @@ fn compare_number_of_generics<'tcx>(
648649
declaration has {} {kind} parameter{}",
649650
trait_.ident,
650651
impl_count,
651-
if impl_count != 1 { "s" } else { "" },
652+
pluralise!(impl_count),
652653
trait_count,
653-
if trait_count != 1 { "s" } else { "" },
654+
pluralise!(trait_count),
654655
kind = kind,
655656
),
656657
DiagnosticId::Error("E0049".into()),
@@ -665,7 +666,7 @@ fn compare_number_of_generics<'tcx>(
665666
"expected {} {} parameter{}",
666667
trait_count,
667668
kind,
668-
if trait_count != 1 { "s" } else { "" },
669+
pluralise!(trait_count),
669670
));
670671
}
671672
for span in spans {
@@ -680,7 +681,7 @@ fn compare_number_of_generics<'tcx>(
680681
"found {} {} parameter{}{}",
681682
impl_count,
682683
kind,
683-
if impl_count != 1 { "s" } else { "" },
684+
pluralise!(impl_count),
684685
suffix.unwrap_or_else(|| String::new()),
685686
));
686687
}

src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(associated_type_bounds)]
44

src/test/ui/associated-type-bounds/fn-apit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_aux;

src/test/ui/associated-type-bounds/fn-dyn-apit.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-dyn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_dyn_aux;

src/test/ui/associated-type-bounds/fn-inline.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_aux;

0 commit comments

Comments
 (0)