-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added lint for #[deriving] structs and enums with unsafe pointers. #1…
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#[feature(struct_variant)]; | ||
#[allow(dead_code)]; | ||
#[deny(raw_pointer_deriving)]; | ||
|
||
#[deriving(Clone)] | ||
struct Foo { | ||
x: *int //~ ERROR use of `#[deriving]` with a raw pointer | ||
} | ||
|
||
#[deriving(Clone)] | ||
struct Bar(*mut int); //~ ERROR use of `#[deriving]` with a raw pointer | ||
|
||
#[deriving(Clone)] | ||
enum Baz { | ||
A(*int), //~ ERROR use of `#[deriving]` with a raw pointer | ||
B { x: *mut int } //~ ERROR use of `#[deriving]` with a raw pointer | ||
} | ||
|
||
#[deriving(Clone)] | ||
struct Buzz { | ||
x: (*int, //~ ERROR use of `#[deriving]` with a raw pointer | ||
*uint) //~ ERROR use of `#[deriving]` with a raw pointer | ||
} | ||
|
||
fn main() {} |
5744556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from huonw
at https://github.com/pongad/rust/commit/5744556782d072076ba426627fd5594c3c9db174
5744556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pongad/rust/lintraw = 5744556 into auto
5744556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pongad/rust/lintraw = 5744556 merged ok, testing candidate = 5a68892
5744556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/4927
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/4930
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4021
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4033
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5029
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4114
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4122
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5029
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/4114
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4119
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/4185
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/1917
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5026
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4124
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4134
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/4791
5744556
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 5a68892