Skip to content

Commit e6abcbc

Browse files
committed
Auto merge of #28938 - GlenDC:master, r=Manishearth
Here is my attempt to resolve issue #28822, @Manishearth. Please let me know if it's fine. And if not, what should I do instead? This issue felt like quite a good start for some rust contributions. It allows me to get used to the workflow and codebase of rust in an easy-to-swallow manner. Are there any other issues you would recommend me to look at? :) Would love to do some more stuff!
2 parents 8091cb1 + 5554636 commit e6abcbc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/librustc/middle/check_const.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
177177
for arg in &fd.inputs {
178178
match arg.pat.node {
179179
hir::PatIdent(hir::BindByValue(hir::MutImmutable), _, None) => {}
180+
hir::PatWild(_) => {}
180181
_ => {
181182
span_err!(self.tcx.sess, arg.pat.span, E0022,
182183
"arguments of constant functions can only \

src/test/run-pass/issue-28822.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(const_fn)]
12+
13+
fn main() {}
14+
15+
const fn size_ofs(_: usize) {}
16+
const fn size_ofs2(_foo: usize) {}

0 commit comments

Comments
 (0)