Skip to content

Rollup of 22 pull requests #63015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
63f2c22
Add missing doc links in boxed module
GuillaumeGomez Jul 2, 2019
c8aa3c1
Add missing type links in Pin documentation
GuillaumeGomez Jul 4, 2019
5a4845d
Implement Unpin for all raw pointers
sfackler Jul 11, 2019
dee3d27
allow clippy::unreadable_literal in unicode tables
euclio Jun 23, 2019
8c050fc
rustc: compute `ty::layout::Niche`'s `available` on the fly.
eddyb Jul 11, 2019
dfbf464
rustc_target: move abi::Niche from rustc::ty::layout.
eddyb Jul 12, 2019
88eced5
rustc: precompute the largest Niche and store it in LayoutDetails.
eddyb Jul 15, 2019
d1aca3a
renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as p…
Xandkeeper Apr 1, 2019
6a9d749
fixed breaking changes
Xandkeeper Apr 2, 2019
f2a9721
Use DerefMut
JohnTitor Jul 5, 2019
59634bc
Replace deref with as_deref
JohnTitor Jul 5, 2019
3427a14
Remove support for -Zlower-128bit-ops
bjorn3 Jul 19, 2019
e8a1e73
Update compiler_builtins to 0.1.18
bjorn3 Jul 20, 2019
93de733
Remove tests for -Zlower-128bit-ops
bjorn3 Jul 20, 2019
6fae7db
Remove vector fadd/fmul reduction workarounds
nikic Jul 20, 2019
279c399
code cleanup
bpangWR Jul 22, 2019
fe4cdd3
Disable d32 on armv6 hf targets
nikic Jul 23, 2019
71717b9
Initialize the MSP430 AsmParser if available
nikic Jul 23, 2019
70c817a
Allow lexer to recover from some homoglyphs
estebank Jul 24, 2019
b01b5b9
ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar
pietroalbini Jul 25, 2019
0e022f8
Remove needless indirection through Rc
Mark-Simulacrum Jul 25, 2019
dd0f2ac
librustc_errors: Support ui-testing flag in annotate-snippet emitter
phansch Jul 25, 2019
6844976
review comments: add FIXME comments and formatting
estebank Jul 25, 2019
df4b23e
Implement slow-path for FirstSets::first
ia0 Jul 24, 2019
9d796eb
`run_quiet` outputs stdout/stderr when things go wrong.
gilescope Jul 25, 2019
0576062
clarify and unify some type test names
RalfJung Jul 24, 2019
3284472
Add test for issue-54062
JohnTitor Jul 26, 2019
4a2f9b6
Remove redundant `mut` from variable declaration.
tomasz-rozanski Jul 26, 2019
c69f367
std: Add more accessors for `Metadata` on Windows
alexcrichton Jul 25, 2019
fb9f3e6
ci: add debug checks for pypi network outages
pietroalbini Jul 26, 2019
68d94bd
Rollup merge of #62084 - euclio:unicode-table-tweak, r=kennytm
Centril Jul 26, 2019
58b53d1
Rollup merge of #62120 - GuillaumeGomez:add-missing-type-links, r=Cen…
Centril Jul 26, 2019
67009d3
Rollup merge of #62310 - GuillaumeGomez:add-missing-doc-links-boxed, …
Centril Jul 26, 2019
625aa60
Rollup merge of #62421 - JohnTitor:U007D-master, r=alexcrichton
Centril Jul 26, 2019
d1f86c1
Rollup merge of #62583 - sfackler:unpin-raw, r=cramertj
Centril Jul 26, 2019
9d12267
Rollup merge of #62692 - eddyb:precompute-niches, r=oli-obk
Centril Jul 26, 2019
632ce74
Rollup merge of #62801 - bjorn3:remove_lower_128bit_ops, r=alexcrichton
Centril Jul 26, 2019
5ffdca7
Rollup merge of #62828 - nikic:fadd-mul-reductions, r=eddyb
Centril Jul 26, 2019
ceea0be
Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
Centril Jul 26, 2019
ba835df
Rollup merge of #62904 - nikic:arm-d32, r=alexcrichton
Centril Jul 26, 2019
183aab3
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Centril Jul 26, 2019
c6c8693
Rollup merge of #62956 - ia0:fix_62831, r=petrochenkov
Centril Jul 26, 2019
1893ac6
Rollup merge of #62963 - estebank:homoglyph-recovery, r=petrochenkov
Centril Jul 26, 2019
035078f
Rollup merge of #62964 - RalfJung:ty-tests, r=Centril
Centril Jul 26, 2019
7e1ce7d
Rollup merge of #62970 - pietroalbini:fix-tools-builder, r=alexcrichton
Centril Jul 26, 2019
15398b6
Rollup merge of #62980 - alexcrichton:windows-metadata, r=sfackler
Centril Jul 26, 2019
0614a94
Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petroc…
Centril Jul 26, 2019
571a965
Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebank
Centril Jul 26, 2019
8882e42
Rollup merge of #63002 - gilescope:better-build-diagnostics, r=Mark-S…
Centril Jul 26, 2019
3a1ee9b
Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Centril Jul 26, 2019
0222498
Rollup merge of #63007 - pietroalbini:debug-awscli-install, r=Mark-Si…
Centril Jul 26, 2019
232d27c
Rollup merge of #63009 - Rosto75:master, r=matklad
Centril Jul 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/libsyntax/ext/tt/macro_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ use rustc_data_structures::sync::Lrc;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::mem;
use std::ops::{Deref, DerefMut};
use std::rc::Rc;

// To avoid costly uniqueness checks, we require that `MatchSeq` always has a nonempty body.

Expand Down Expand Up @@ -280,7 +279,7 @@ pub enum ParseResult<T> {

/// A `ParseResult` where the `Success` variant contains a mapping of `Ident`s to `NamedMatch`es.
/// This represents the mapping of metavars to the token trees they bind to.
pub type NamedParseResult = ParseResult<FxHashMap<Ident, Rc<NamedMatch>>>;
pub type NamedParseResult = ParseResult<FxHashMap<Ident, NamedMatch>>;

/// Count how many metavars are named in the given matcher `ms`.
pub fn count_names(ms: &[TokenTree]) -> usize {
Expand Down Expand Up @@ -373,7 +372,7 @@ fn nameize<I: Iterator<Item = NamedMatch>>(
sess: &ParseSess,
m: &TokenTree,
res: &mut I,
ret_val: &mut FxHashMap<Ident, Rc<NamedMatch>>,
ret_val: &mut FxHashMap<Ident, NamedMatch>,
) -> Result<(), (syntax_pos::Span, String)> {
match *m {
TokenTree::Sequence(_, ref seq) => for next_m in &seq.tts {
Expand All @@ -390,8 +389,7 @@ fn nameize<I: Iterator<Item = NamedMatch>>(
TokenTree::MetaVarDecl(sp, bind_name, _) => {
match ret_val.entry(bind_name) {
Vacant(spot) => {
// FIXME(simulacrum): Don't construct Rc here
spot.insert(Rc::new(res.next().unwrap()));
spot.insert(res.next().unwrap());
}
Occupied(..) => {
return Err((sp, format!("duplicated bind name: {}", bind_name)))
Expand Down
4 changes: 2 additions & 2 deletions src/libsyntax/ext/tt/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub fn compile(
let mut valid = true;

// Extract the arguments:
let lhses = match *argument_map[&lhs_nm] {
let lhses = match argument_map[&lhs_nm] {
MatchedSeq(ref s, _) => s
.iter()
.map(|m| {
Expand All @@ -335,7 +335,7 @@ pub fn compile(
_ => sess.span_diagnostic.span_bug(def.span, "wrong-structured lhs"),
};

let rhses = match *argument_map[&rhs_nm] {
let rhses = match argument_map[&rhs_nm] {
MatchedSeq(ref s, _) => s
.iter()
.map(|m| {
Expand Down
24 changes: 11 additions & 13 deletions src/libsyntax/ext/tt/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use smallvec::{smallvec, SmallVec};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use std::mem;
use std::rc::Rc;

/// An iterator over the token trees in a delimited token tree (`{ ... }`) or a sequence (`$(...)`).
enum Frame {
Expand Down Expand Up @@ -65,9 +64,9 @@ impl Iterator for Frame {
/// `transcribe` would return a `TokenStream` containing `println!("{}", stringify!(bar));`.
///
/// Along the way, we do some additional error checking.
pub fn transcribe(
pub(super) fn transcribe(
cx: &ExtCtxt<'_>,
interp: &FxHashMap<Ident, Rc<NamedMatch>>,
interp: &FxHashMap<Ident, NamedMatch>,
src: Vec<quoted::TokenTree>,
) -> TokenStream {
// Nothing for us to transcribe...
Expand Down Expand Up @@ -212,7 +211,7 @@ pub fn transcribe(
// Find the matched nonterminal from the macro invocation, and use it to replace
// the meta-var.
if let Some(cur_matched) = lookup_cur_matched(ident, interp, &repeats) {
if let MatchedNonterminal(ref nt) = *cur_matched {
if let MatchedNonterminal(ref nt) = cur_matched {
// FIXME #2887: why do we apply a mark when matching a token tree meta-var
// (e.g. `$x:tt`), but not when we are matching any other type of token
// tree?
Expand Down Expand Up @@ -273,18 +272,17 @@ pub fn transcribe(
/// See the definition of `repeats` in the `transcribe` function. `repeats` is used to descend
/// into the right place in nested matchers. If we attempt to descend too far, the macro writer has
/// made a mistake, and we return `None`.
fn lookup_cur_matched(
fn lookup_cur_matched<'a>(
ident: Ident,
interpolations: &FxHashMap<Ident, Rc<NamedMatch>>,
interpolations: &'a FxHashMap<Ident, NamedMatch>,
repeats: &[(usize, usize)],
) -> Option<Rc<NamedMatch>> {
) -> Option<&'a NamedMatch> {
interpolations.get(&ident).map(|matched| {
let mut matched = matched.clone();
let mut matched = matched;
for &(idx, _) in repeats {
let m = matched.clone();
match *m {
match matched {
MatchedNonterminal(_) => break,
MatchedSeq(ref ads, _) => matched = Rc::new(ads[idx].clone()),
MatchedSeq(ref ads, _) => matched = ads.get(idx).unwrap(),
}
}

Expand Down Expand Up @@ -343,7 +341,7 @@ impl LockstepIterSize {
/// multiple nested matcher sequences.
fn lockstep_iter_size(
tree: &quoted::TokenTree,
interpolations: &FxHashMap<Ident, Rc<NamedMatch>>,
interpolations: &FxHashMap<Ident, NamedMatch>,
repeats: &[(usize, usize)],
) -> LockstepIterSize {
use quoted::TokenTree;
Expand All @@ -360,7 +358,7 @@ fn lockstep_iter_size(
}
TokenTree::MetaVar(_, name) | TokenTree::MetaVarDecl(_, name, _) => {
match lookup_cur_matched(name, interpolations, repeats) {
Some(matched) => match *matched {
Some(matched) => match matched {
MatchedNonterminal(_) => LockstepIterSize::Unconstrained,
MatchedSeq(ref ads, _) => LockstepIterSize::Constraint(ads.len(), name),
},
Expand Down