Skip to content

Commit 8d86d1a

Browse files
committed
Auto merge of #29215 - fhahn:issue-28157-bad-semicolon, r=alexcrichton
PR for #28157. At the moment, `rustc` emits a warning when a bare semicolon is encountered (could also be a fail, but I think this is a backwards incompatible change). Also I am not sure where the best place for a test for that warning would be. Seems run-pass tests do not check warnings.
2 parents 04e497c + 1e62bd2 commit 8d86d1a

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

src/doc/grammar.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ meta_seq : meta_item [ ',' meta_seq ] ? ;
436436
## Statements
437437

438438
```antlr
439-
stmt : decl_stmt | expr_stmt ;
439+
stmt : decl_stmt | expr_stmt | ';' ;
440440
```
441441

442442
### Declaration statements

src/librustc/metadata/cstore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl CStore {
207207
visit(cstore, dep, ordering);
208208
}
209209
ordering.push(cnum);
210-
};
210+
}
211211
for (&num, _) in self.metas.borrow().iter() {
212212
visit(self, num, &mut ordering);
213213
}

src/librustc_trans/save/dump_csv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ macro_rules! down_cast_data {
5858
data
5959
} else {
6060
$this.sess.span_bug($sp, &format!("unexpected data kind: {:?}", $id));
61-
};
61+
}
6262
};
6363
}
6464

src/librustc_trans/trans/debuginfo/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ macro_rules! return_if_metadata_created_in_meantime {
480480
.find_metadata_for_unique_id($unique_type_id) {
481481
Some(metadata) => return MetadataCreationResult::new(metadata, true),
482482
None => { /* proceed normally */ }
483-
};
483+
}
484484
)
485485
}
486486

src/librustdoc/passes.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
2828
let krate = {
2929
struct Stripper<'a> {
3030
stripped: &'a mut DefIdSet
31-
};
31+
}
3232
impl<'a> fold::DocFolder for Stripper<'a> {
3333
fn fold_item(&mut self, i: Item) -> Option<Item> {
3434
if i.is_hidden_from_doc() {
@@ -60,7 +60,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
6060
let krate = {
6161
struct ImplStripper<'a> {
6262
stripped: &'a mut DefIdSet
63-
};
63+
}
6464
impl<'a> fold::DocFolder for ImplStripper<'a> {
6565
fn fold_item(&mut self, i: Item) -> Option<Item> {
6666
if let clean::ImplItem(clean::Impl{

src/libstd/sys/common/wtf8.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ mod tests {
10191019
fn wtf8buf_from_iterator() {
10201020
fn f(values: &[u32]) -> Wtf8Buf {
10211021
values.iter().map(|&c| CodePoint::from_u32(c).unwrap()).collect::<Wtf8Buf>()
1022-
};
1022+
}
10231023
assert_eq!(f(&[0x61, 0xE9, 0x20, 0x1F4A9]).bytes, b"a\xC3\xA9 \xF0\x9F\x92\xA9");
10241024

10251025
assert_eq!(f(&[0xD83D, 0xDCA9]).bytes, b"\xF0\x9F\x92\xA9"); // Magic!
@@ -1038,7 +1038,7 @@ mod tests {
10381038
let mut string = initial.iter().map(c).collect::<Wtf8Buf>();
10391039
string.extend(extended.iter().map(c));
10401040
string
1041-
};
1041+
}
10421042

10431043
assert_eq!(e(&[0x61, 0xE9], &[0x20, 0x1F4A9]).bytes,
10441044
b"a\xC3\xA9 \xF0\x9F\x92\xA9");

src/libterm/terminfo/searcher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn test_get_dbpath_for_term() {
102102
fn x(t: &str) -> String {
103103
let p = get_dbpath_for_term(t).expect("no terminfo entry found");
104104
p.to_str().unwrap().to_string()
105-
};
105+
}
106106
assert!(x("screen") == "/usr/share/terminfo/s/screen");
107107
assert!(get_dbpath_for_term("") == None);
108108
env::set_var("TERMINFO_DIRS", ":");

src/libtest/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ pub fn filter_tests(opts: &TestOpts, tests: Vec<TestDescAndFn>) -> Vec<TestDescA
924924
} else {
925925
None
926926
}
927-
};
927+
}
928928
filtered.into_iter().filter_map(filter).collect()
929929
};
930930

0 commit comments

Comments
 (0)