Skip to content

Commit

Permalink
chore: use shorthand initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Aug 2, 2024
1 parent 5367673 commit dbe29db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/alloc_error_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn generate_handler(cx: &ExtCtxt<'_>, handler: Ident, span: Span, sig_span: Span
let params = thin_vec![cx.param(span, size, ty_usize.clone()), cx.param(span, align, ty_usize)];
let decl = cx.fn_decl(params, never);
let header = FnHeader { safety: Safety::Unsafe(span), ..FnHeader::default() };
let sig = FnSig { decl, header, span: span };
let sig = FnSig { decl, header, span };

let body = Some(cx.block_expr(call));
let kind = ItemKind::Fn(Box::new(Fn {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/query/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ pub fn report_cycle<'a>(
cycle_stack,
stack_bottom: stack[0].query.description.to_owned(),
alias,
cycle_usage: cycle_usage,
cycle_usage,
stack_count,
note_span: (),
};
Expand Down
4 changes: 2 additions & 2 deletions tests/ui-fulldeps/regions-mock-tcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ struct TypeContext<'tcx, 'ast> {
impl<'tcx,'ast> TypeContext<'tcx, 'ast> {
fn new(ty_arena: &'tcx TyArena<'tcx>, ast_arena: &'ast AstArena<'ast>)
-> TypeContext<'tcx, 'ast> {
TypeContext { ty_arena: ty_arena,
TypeContext { ty_arena,
types: Vec::new(),
type_table: HashMap::new(),

ast_arena: ast_arena,
ast_arena,
ast_counter: 0 }
}

Expand Down
28 changes: 14 additions & 14 deletions tests/ui/drop/dropck_legal_cycles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ struct S<'a> {

impl<'a> Named for S<'a> {
fn new(name: &'static str) -> S<'a> {
S { name: name, mark: Cell::new(0), next: Cell::new(None) }
S { name, mark: Cell::new(0), next: Cell::new(None) }
}
fn name(&self) -> &str { self.name }
}
Expand All @@ -468,7 +468,7 @@ struct S2<'a> {

impl<'a> Named for S2<'a> {
fn new(name: &'static str) -> S2<'a> {
S2 { name: name, mark: Cell::new(0), next: Cell::new((None, None)) }
S2 { name, mark: Cell::new(0), next: Cell::new((None, None)) }
}
fn name(&self) -> &str { self.name }
}
Expand All @@ -488,7 +488,7 @@ struct V<'a> {

impl<'a> Named for V<'a> {
fn new(name: &'static str) -> V<'a> {
V { name: name,
V { name,
mark: Cell::new(0),
contents: vec![Cell::new(None), Cell::new(None)]
}
Expand All @@ -510,7 +510,7 @@ struct H<'a> {

impl<'a> Named for H<'a> {
fn new(name: &'static str) -> H<'a> {
H { name: name, mark: Cell::new(0), next: Cell::new(None) }
H { name, mark: Cell::new(0), next: Cell::new(None) }
}
fn name(&self) -> &str { self.name }
}
Expand Down Expand Up @@ -541,7 +541,7 @@ struct HM<'a> {

impl<'a> Named for HM<'a> {
fn new(name: &'static str) -> HM<'a> {
HM { name: name,
HM { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand Down Expand Up @@ -575,7 +575,7 @@ struct VD<'a> {

impl<'a> Named for VD<'a> {
fn new(name: &'static str) -> VD<'a> {
VD { name: name,
VD { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand All @@ -596,7 +596,7 @@ struct VM<'a> {

impl<'a> Named for VM<'a> {
fn new(name: &'static str) -> VM<'a> {
VM { name: name,
VM { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand All @@ -617,7 +617,7 @@ struct LL<'a> {

impl<'a> Named for LL<'a> {
fn new(name: &'static str) -> LL<'a> {
LL { name: name,
LL { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand All @@ -638,7 +638,7 @@ struct BH<'a> {

impl<'a> Named for BH<'a> {
fn new(name: &'static str) -> BH<'a> {
BH { name: name,
BH { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand Down Expand Up @@ -679,7 +679,7 @@ struct BTM<'a> {

impl<'a> Named for BTM<'a> {
fn new(name: &'static str) -> BTM<'a> {
BTM { name: name,
BTM { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand Down Expand Up @@ -720,7 +720,7 @@ struct BTS<'a> {

impl<'a> Named for BTS<'a> {
fn new(name: &'static str) -> BTS<'a> {
BTS { name: name,
BTS { name,
mark: Cell::new(0),
contents: Cell::new(None)
}
Expand Down Expand Up @@ -765,7 +765,7 @@ struct RCRC<'a>(Rc<RefCell<RCRCData<'a>>>);
impl<'a> Named for RCRC<'a> {
fn new(name: &'static str) -> Self {
RCRC(Rc::new(RefCell::new(RCRCData {
name: name, mark: Cell::new(0), children: (None, None), })))
name, mark: Cell::new(0), children: (None, None), })))
}
fn name(&self) -> &str { self.0.borrow().name }
}
Expand Down Expand Up @@ -802,7 +802,7 @@ struct ARCRC<'a>(Arc<RefCell<ARCRCData<'a>>>);
impl<'a> Named for ARCRC<'a> {
fn new(name: &'static str) -> Self {
ARCRC(Arc::new(RefCell::new(ARCRCData {
name: name, mark: Cell::new(0), children: (None, None), })))
name, mark: Cell::new(0), children: (None, None), })))
}
fn name(&self) -> &str { self.0.borrow().name }
}
Expand Down Expand Up @@ -885,7 +885,7 @@ struct ARCRW<'a>(Arc<RwLock<ARCRWData<'a>>>);
impl<'a> Named for ARCRW<'a> {
fn new(name: &'static str) -> Self {
ARCRW(Arc::new(RwLock::new(ARCRWData {
name: name, mark: Cell::new(0), children: (None, None), })))
name, mark: Cell::new(0), children: (None, None), })))
}
fn name(&self) -> &str { self.0.read().unwrap().name }
}
Expand Down

0 comments on commit dbe29db

Please sign in to comment.