Skip to content
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

Rollup of 6 pull requests #66601

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b380d35
add ui test for issue-62097
csmoe Oct 23, 2019
dcc14c4
suggest to add a constraint except asyn-fn without explicit output
csmoe Oct 23, 2019
9124f7a
update suggestion ui test
csmoe Oct 23, 2019
405866a
re-add miri intrinsic ABI check
RalfJung Nov 16, 2019
44b6811
rename and move read_vector_ty
RalfJung Nov 16, 2019
09180d7
make simd_size return a u64
RalfJung Nov 16, 2019
8952c8a
ICE on invalid MIR
RalfJung Nov 16, 2019
5e115a2
avoid some casts
RalfJung Nov 16, 2019
5b0e702
Create a generic HashStable derive.
cjgillot Nov 9, 2019
c2e1658
Use proc_macro for HashStable derive in libsyntax.
cjgillot Nov 9, 2019
05f5f76
Move impl HashStable for SymbolStr in libsyntax_pos.
cjgillot Nov 9, 2019
1dd5133
Move impl HashStable for Symbol in libsyntax_pos.
cjgillot Nov 9, 2019
efcb695
Further HashStable_Generic derives.
cjgillot Nov 9, 2019
2a67986
HashStable literals in libsyntax.
cjgillot Nov 9, 2019
a265bc2
HashStable_Generic for libsyntax_pos.
cjgillot Nov 9, 2019
2ba84c6
HashStable_Generic for librustc_target.
cjgillot Nov 9, 2019
333c114
Derive HashStable in librustc_target.
cjgillot Nov 9, 2019
375a761
HashStable in libsyntax.
cjgillot Nov 9, 2019
79bde05
Derive HashStable for PanicStrategy.
cjgillot Nov 9, 2019
e8e7ad6
Implement HashStable for RangeInclusive.
cjgillot Nov 16, 2019
5b4dad7
Derive HashStable_Generic for ABI types.
cjgillot Nov 16, 2019
3d97a91
Remove extern crate.
cjgillot Nov 16, 2019
44a595f
Simplify impl for SymbolStr.
cjgillot Nov 16, 2019
eda67ba
Disable gdb pretty printer global section on wasm targets
alexcrichton Nov 18, 2019
bca64ce
Point at type in `let` assignment on type errors
estebank Nov 19, 2019
44cebe5
reduce size of hir::ExprKind
Centril Nov 18, 2019
166b13b
Rollup merge of #65730 - csmoe:return-lifetime, r=nikomatsakis
Centril Nov 21, 2019
fe1f735
Rollup merge of #66460 - cjgillot:hashstable_generic, r=Zoxc
Centril Nov 21, 2019
9761a69
Rollup merge of #66468 - RalfJung:simd-cleanup, r=oli-obk
Centril Nov 21, 2019
90e7976
Rollup merge of #66515 - Centril:cheaper-inline-asm, r=oli-obk
Centril Nov 21, 2019
5585280
Rollup merge of #66520 - alexcrichton:disable-gdb-wasm, r=eddyb
Centril Nov 21, 2019
6815e4b
Rollup merge of #66539 - estebank:let-ty, r=Centril
Centril Nov 21, 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
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3837,6 +3837,7 @@ dependencies = [
"log",
"rustc_data_structures",
"rustc_index",
"rustc_macros",
"serialize",
"syntax_pos",
]
Expand Down Expand Up @@ -4404,6 +4405,7 @@ dependencies = [
"rustc_errors",
"rustc_index",
"rustc_lexer",
"rustc_macros",
"scoped-tls",
"serialize",
"smallvec 1.0.0",
Expand Down
7 changes: 3 additions & 4 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,9 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
ExprKind::Ret(ref optional_expression) => {
walk_list!(visitor, visit_expr, optional_expression);
}
ExprKind::InlineAsm(_, ref outputs, ref inputs) => {
for expr in outputs.iter().chain(inputs.iter()) {
visitor.visit_expr(expr)
}
ExprKind::InlineAsm(ref asm) => {
walk_list!(visitor, visit_expr, &asm.outputs_exprs);
walk_list!(visitor, visit_expr, &asm.inputs_exprs);
}
ExprKind::Yield(ref subexpression, _) => {
visitor.visit_expr(subexpression);
Expand Down
14 changes: 12 additions & 2 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,16 @@ impl<'a> LoweringContext<'a> {
impl_trait_return_allow: bool,
make_ret_async: Option<NodeId>,
) -> P<hir::FnDecl> {
debug!("lower_fn_decl(\
fn_decl: {:?}, \
in_band_ty_params: {:?}, \
impl_trait_return_allow: {}, \
make_ret_async: {:?})",
decl,
in_band_ty_params,
impl_trait_return_allow,
make_ret_async,
);
let lt_mode = if make_ret_async.is_some() {
// In `async fn`, argument-position elided lifetimes
// must be transformed into fresh generic parameters so that
Expand Down Expand Up @@ -2462,7 +2472,7 @@ impl<'a> LoweringContext<'a> {

hir::FunctionRetTy::Return(P(hir::Ty {
kind: opaque_ty_ref,
span,
span: opaque_ty_span,
hir_id: self.next_id(),
}))
}
Expand Down Expand Up @@ -2572,7 +2582,7 @@ impl<'a> LoweringContext<'a> {
hir::Lifetime {
hir_id: self.lower_node_id(id),
span,
name: name,
name,
}
}

Expand Down
26 changes: 13 additions & 13 deletions src/librustc/hir/lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ impl LoweringContext<'_> {
}

fn lower_expr_asm(&mut self, asm: &InlineAsm) -> hir::ExprKind {
let hir_asm = hir::InlineAsm {
let inner = hir::InlineAsmInner {
inputs: asm.inputs.iter().map(|&(ref c, _)| c.clone()).collect(),
outputs: asm.outputs
.iter()
Expand All @@ -984,18 +984,18 @@ impl LoweringContext<'_> {
alignstack: asm.alignstack,
dialect: asm.dialect,
};

let outputs = asm.outputs
.iter()
.map(|out| self.lower_expr(&out.expr))
.collect();

let inputs = asm.inputs
.iter()
.map(|&(_, ref input)| self.lower_expr(input))
.collect();

hir::ExprKind::InlineAsm(P(hir_asm), outputs, inputs)
let hir_asm = hir::InlineAsm {
inner,
inputs_exprs: asm.inputs
.iter()
.map(|&(_, ref input)| self.lower_expr(input))
.collect(),
outputs_exprs: asm.outputs
.iter()
.map(|out| self.lower_expr(&out.expr))
.collect(),
};
hir::ExprKind::InlineAsm(P(hir_asm))
}

fn lower_field(&mut self, f: &Field) -> hir::Field {
Expand Down
13 changes: 10 additions & 3 deletions src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ pub struct Expr {

// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
static_assert_size!(Expr, 72);
static_assert_size!(Expr, 64);

impl Expr {
pub fn precedence(&self) -> ExprPrecedence {
Expand Down Expand Up @@ -1656,7 +1656,7 @@ pub enum ExprKind {
Ret(Option<P<Expr>>),

/// Inline assembly (from `asm!`), with its outputs and inputs.
InlineAsm(P<InlineAsm>, HirVec<Expr>, HirVec<Expr>),
InlineAsm(P<InlineAsm>),

/// A struct or struct-like variant literal expression.
///
Expand Down Expand Up @@ -2063,7 +2063,7 @@ pub struct InlineAsmOutput {
// NOTE(eddyb) This is used within MIR as well, so unlike the rest of the HIR,
// it needs to be `Clone` and use plain `Vec<T>` instead of `HirVec<T>`.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
pub struct InlineAsm {
pub struct InlineAsmInner {
pub asm: Symbol,
pub asm_str_style: StrStyle,
pub outputs: Vec<InlineAsmOutput>,
Expand All @@ -2074,6 +2074,13 @@ pub struct InlineAsm {
pub dialect: AsmDialect,
}

#[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
pub struct InlineAsm {
pub inner: InlineAsmInner,
pub outputs_exprs: HirVec<Expr>,
pub inputs_exprs: HirVec<Expr>,
}

/// Represents a parameter in a function header.
#[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
pub struct Param {
Expand Down
21 changes: 11 additions & 10 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,14 +1365,15 @@ impl<'a> State<'a> {
self.print_expr_maybe_paren(&expr, parser::PREC_JUMP);
}
}
hir::ExprKind::InlineAsm(ref a, ref outputs, ref inputs) => {
hir::ExprKind::InlineAsm(ref a) => {
let i = &a.inner;
self.s.word("asm!");
self.popen();
self.print_string(&a.asm.as_str(), a.asm_str_style);
self.print_string(&i.asm.as_str(), i.asm_str_style);
self.word_space(":");

let mut out_idx = 0;
self.commasep(Inconsistent, &a.outputs, |s, out| {
self.commasep(Inconsistent, &i.outputs, |s, out| {
let constraint = out.constraint.as_str();
let mut ch = constraint.chars();
match ch.next() {
Expand All @@ -1383,36 +1384,36 @@ impl<'a> State<'a> {
_ => s.print_string(&constraint, ast::StrStyle::Cooked),
}
s.popen();
s.print_expr(&outputs[out_idx]);
s.print_expr(&a.outputs_exprs[out_idx]);
s.pclose();
out_idx += 1;
});
self.s.space();
self.word_space(":");

let mut in_idx = 0;
self.commasep(Inconsistent, &a.inputs, |s, co| {
self.commasep(Inconsistent, &i.inputs, |s, co| {
s.print_string(&co.as_str(), ast::StrStyle::Cooked);
s.popen();
s.print_expr(&inputs[in_idx]);
s.print_expr(&a.inputs_exprs[in_idx]);
s.pclose();
in_idx += 1;
});
self.s.space();
self.word_space(":");

self.commasep(Inconsistent, &a.clobbers, |s, co| {
self.commasep(Inconsistent, &i.clobbers, |s, co| {
s.print_string(&co.as_str(), ast::StrStyle::Cooked);
});

let mut options = vec![];
if a.volatile {
if i.volatile {
options.push("volatile");
}
if a.alignstack {
if i.alignstack {
options.push("alignstack");
}
if a.dialect == ast::AsmDialect::Intel {
if i.dialect == ast::AsmDialect::Intel {
options.push("intel");
}

Expand Down
5 changes: 0 additions & 5 deletions src/librustc/ich/impls_hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::ImplItem {
}
}

impl_stable_hash_for!(enum ast::CrateSugar {
JustCrate,
PubCrate,
});

impl<'a> HashStable<StableHashingContext<'a>> for hir::VisibilityKind {
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
mem::discriminant(self).hash_stable(hcx, hasher);
Expand Down
7 changes: 0 additions & 7 deletions src/librustc/ich/impls_misc.rs

This file was deleted.

Loading