Skip to content

Rollup of 6 pull requests #104776

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 19 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0a275ab
copy doc output files by format r=ozkanonur
onur-ozkan Nov 13, 2022
7e28df9
refactor doc copying process
onur-ozkan Nov 20, 2022
616df0f
`rustc_parse`: remove `ref` patterns
WaffleLapkin Nov 22, 2022
a603635
`rustc_arena`: remove a couple of `ref` patterns
WaffleLapkin Nov 22, 2022
b97ec39
`rustc_ast_lowering`: remove `ref` patterns
WaffleLapkin Nov 22, 2022
1c80a56
rustdoc: make struct fields `display: block`
notriddle Nov 22, 2022
7c3f631
Fix an ICE parsing a malformed attribute.
nnethercote Nov 22, 2022
cbe9328
Do not need to account for overflow in predicate_can_apply
compiler-errors Nov 11, 2022
a884a9e
Drive-by: Don't manually call evaluate_obligation_no_overflow
compiler-errors Nov 11, 2022
9decfff
Add fatal overflow test
compiler-errors Nov 18, 2022
ad094cd
Use ObligationCtxt intead of dyn TraitEngine
spastorino Nov 16, 2022
5b3a06a
Call fully_solve_obligations instead of repeating code
spastorino Nov 17, 2022
859b147
Pass ObligationCtxt from enter_canonical_trait_query and use Obligati…
spastorino Nov 16, 2022
bd91c94
Rollup merge of #104269 - compiler-errors:hang-in-where-clause-sugg, …
Dylan-DPC Nov 23, 2022
d3e9191
Rollup merge of #104286 - ozkanonur:fix-doc-bootstrap-recompilation, …
Dylan-DPC Nov 23, 2022
0a79138
Rollup merge of #104509 - spastorino:use-obligation-ctxt, r=lcnr
Dylan-DPC Nov 23, 2022
c03026a
Rollup merge of #104721 - WaffleLapkin:deref-harder, r=oli-obk
Dylan-DPC Nov 23, 2022
a39ed5c
Rollup merge of #104744 - notriddle:notriddle/struct-fields-display-b…
Dylan-DPC Nov 23, 2022
5d7b68c
Rollup merge of #104751 - nnethercote:fix-104620, r=petrochenkov
Dylan-DPC Nov 23, 2022
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
16 changes: 6 additions & 10 deletions compiler/rustc_arena/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,15 @@ fn test_arena_alloc_nested() {

impl<'a> Wrap<'a> {
fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
let r: &EI<'_> = self.0.alloc(EI::I(f()));
if let &EI::I(ref i) = r {
i
} else {
panic!("mismatch");
match self.0.alloc(EI::I(f())) {
EI::I(i) => i,
_ => panic!("mismatch"),
}
}
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
let r: &EI<'_> = self.0.alloc(EI::O(f()));
if let &EI::O(ref o) = r {
o
} else {
panic!("mismatch");
match self.0.alloc(EI::O(f())) {
EI::O(o) => o,
_ => panic!("mismatch"),
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,12 @@ impl MetaItemKind {
}) => MetaItemKind::list_from_tokens(tokens.clone()),
AttrArgs::Delimited(..) => None,
AttrArgs::Eq(_, AttrArgsEq::Ast(expr)) => match expr.kind {
ast::ExprKind::Lit(token_lit) => Some(MetaItemKind::NameValue(
Lit::from_token_lit(token_lit, expr.span).expect("token_lit in from_attr_args"),
)),
ast::ExprKind::Lit(token_lit) => {
// Turn failures to `None`, we'll get parse errors elsewhere.
Lit::from_token_lit(token_lit, expr.span)
.ok()
.map(|lit| MetaItemKind::NameValue(lit))
}
_ => None,
},
AttrArgs::Eq(_, AttrArgsEq::Hir(lit)) => Some(MetaItemKind::NameValue(lit.clone())),
Expand Down
32 changes: 15 additions & 17 deletions compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
.operands
.iter()
.map(|(op, op_sp)| {
let lower_reg = |reg| match reg {
let lower_reg = |&reg: &_| match reg {
InlineAsmRegOrRegClass::Reg(reg) => {
asm::InlineAsmRegOrRegClass::Reg(if let Some(asm_arch) = asm_arch {
asm::InlineAsmReg::parse(asm_arch, reg).unwrap_or_else(|error| {
Expand Down Expand Up @@ -152,32 +152,30 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}
};

let op = match *op {
InlineAsmOperand::In { reg, ref expr } => hir::InlineAsmOperand::In {
let op = match op {
InlineAsmOperand::In { reg, expr } => hir::InlineAsmOperand::In {
reg: lower_reg(reg),
expr: self.lower_expr(expr),
},
InlineAsmOperand::Out { reg, late, ref expr } => hir::InlineAsmOperand::Out {
InlineAsmOperand::Out { reg, late, expr } => hir::InlineAsmOperand::Out {
reg: lower_reg(reg),
late,
late: *late,
expr: expr.as_ref().map(|expr| self.lower_expr(expr)),
},
InlineAsmOperand::InOut { reg, late, ref expr } => {
hir::InlineAsmOperand::InOut {
reg: lower_reg(reg),
late,
expr: self.lower_expr(expr),
}
}
InlineAsmOperand::SplitInOut { reg, late, ref in_expr, ref out_expr } => {
InlineAsmOperand::InOut { reg, late, expr } => hir::InlineAsmOperand::InOut {
reg: lower_reg(reg),
late: *late,
expr: self.lower_expr(expr),
},
InlineAsmOperand::SplitInOut { reg, late, in_expr, out_expr } => {
hir::InlineAsmOperand::SplitInOut {
reg: lower_reg(reg),
late,
late: *late,
in_expr: self.lower_expr(in_expr),
out_expr: out_expr.as_ref().map(|expr| self.lower_expr(expr)),
}
}
InlineAsmOperand::Const { ref anon_const } => {
InlineAsmOperand::Const { anon_const } => {
if !self.tcx.features().asm_const {
feature_err(
&sess.parse_sess,
Expand All @@ -191,7 +189,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
anon_const: self.lower_anon_const(anon_const),
}
}
InlineAsmOperand::Sym { ref sym } => {
InlineAsmOperand::Sym { sym } => {
let static_def_id = self
.resolver
.get_partial_res(sym.id)
Expand Down Expand Up @@ -347,7 +345,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
skip = true;

let idx2 = *o.get();
let &(ref op2, op_sp2) = &operands[idx2];
let (ref op2, op_sp2) = operands[idx2];
let Some(asm::InlineAsmRegOrRegClass::Reg(reg2)) = op2.reg() else {
unreachable!();
};
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_ast_lowering/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let mut stmts = SmallVec::<[hir::Stmt<'hir>; 8]>::new();
let mut expr = None;
while let [s, tail @ ..] = ast_stmts {
match s.kind {
StmtKind::Local(ref local) => {
match &s.kind {
StmtKind::Local(local) => {
let hir_id = self.lower_node_id(s.id);
let local = self.lower_local(local);
self.alias_attrs(hir_id, local.hir_id);
let kind = hir::StmtKind::Local(local);
let span = self.lower_span(s.span);
stmts.push(hir::Stmt { hir_id, kind, span });
}
StmtKind::Item(ref it) => {
StmtKind::Item(it) => {
stmts.extend(self.lower_item_ref(it).into_iter().enumerate().map(
|(i, item_id)| {
let hir_id = match i {
Expand All @@ -53,7 +53,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
},
));
}
StmtKind::Expr(ref e) => {
StmtKind::Expr(e) => {
let e = self.lower_expr(e);
if tail.is_empty() {
expr = Some(e);
Expand All @@ -65,7 +65,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
stmts.push(hir::Stmt { hir_id, kind, span });
}
}
StmtKind::Semi(ref e) => {
StmtKind::Semi(e) => {
let e = self.lower_expr(e);
let hir_id = self.lower_node_id(s.id);
self.alias_attrs(hir_id, e.hir_id);
Expand Down
Loading