Skip to content

Commit a6624ed

Browse files
committedSep 8, 2019
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
·
1.87.01.39.0
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"),

0 commit comments

Comments
 (0)
Please sign in to comment.