Skip to content

Commit e185cd5

Browse files
committed
Fix bug in test for E0199 and add test for E0198.
In particular, as far as I can tell from the error diagnostics, the former test for E0199 was actually a test for E0198, and there was no test for E0198. (I am assuming that one of my previous changes to the `unsafe impl` checking fixed a latent bug in how these two cases were differentiated.)
1 parent 9a649c3 commit e185cd5

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/test/compile-fail/E0198.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 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(optin_builtin_traits)]
12+
13+
struct Foo;
14+
15+
unsafe impl !Clone for Foo { } //~ ERROR negative implementations are not unsafe [E0198]
16+
17+
fn main() {
18+
}

src/test/compile-fail/E0199.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
struct Foo;
1414

15-
unsafe impl !Clone for Foo { } //~ ERROR E0199
15+
trait Bar { }
16+
unsafe impl Bar for Foo { } //~ ERROR implementing the trait `Bar` is not unsafe [E0199]
1617

1718
fn main() {
1819
}

0 commit comments

Comments
 (0)