Skip to content

Warning police #6374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/compiletest/compiletest.rc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
#[allow(deprecated_mode)];
#[allow(deprecated_pattern)];

extern mod std(vers = "0.7-pre");
Expand Down
17 changes: 7 additions & 10 deletions src/libcore/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Message passing
*/

use cast::{transmute, transmute_mut};
use cast;
use either::{Either, Left, Right};
use kinds::Owned;
use option::{Option, Some, None};
Expand Down Expand Up @@ -150,7 +149,7 @@ impl<T: Owned> GenericChan<T> for Chan<T> {
fn send(&self, x: T) {
unsafe {
let mut endp = None;
let mut self_endp = transmute_mut(&self.endp);
let self_endp = transmute_mut(&self.endp);
endp <-> *self_endp;
*self_endp = Some(streamp::client::data(endp.unwrap(), x))
}
Expand All @@ -162,7 +161,7 @@ impl<T: Owned> GenericSmartChan<T> for Chan<T> {
fn try_send(&self, x: T) -> bool {
unsafe {
let mut endp = None;
let mut self_endp = transmute_mut(&self.endp);
let self_endp = transmute_mut(&self.endp);
endp <-> *self_endp;
match streamp::client::try_data(endp.unwrap(), x) {
Some(next) => {
Expand All @@ -180,7 +179,7 @@ impl<T: Owned> GenericPort<T> for Port<T> {
fn recv(&self) -> T {
unsafe {
let mut endp = None;
let mut self_endp = transmute_mut(&self.endp);
let self_endp = transmute_mut(&self.endp);
endp <-> *self_endp;
let streamp::data(x, endp) = recv(endp.unwrap());
*self_endp = Some(endp);
Expand All @@ -192,7 +191,7 @@ impl<T: Owned> GenericPort<T> for Port<T> {
fn try_recv(&self) -> Option<T> {
unsafe {
let mut endp = None;
let mut self_endp = transmute_mut(&self.endp);
let self_endp = transmute_mut(&self.endp);
endp <-> *self_endp;
match try_recv(endp.unwrap()) {
Some(streamp::data(x, endp)) => {
Expand All @@ -210,7 +209,7 @@ impl<T: Owned> Peekable<T> for Port<T> {
fn peek(&self) -> bool {
unsafe {
let mut endp = None;
let mut self_endp = transmute_mut(&self.endp);
let self_endp = transmute_mut(&self.endp);
endp <-> *self_endp;
let peek = match endp {
Some(ref mut endp) => peek(endp),
Expand All @@ -224,12 +223,10 @@ impl<T: Owned> Peekable<T> for Port<T> {

impl<T: Owned> Selectable for Port<T> {
fn header(&mut self) -> *mut PacketHeader {
unsafe {
match self.endp {
Some(ref mut endp) => endp.header(),
None => fail!(~"peeking empty stream")
}
}
}
}

Expand Down Expand Up @@ -263,7 +260,7 @@ pub impl<T: Owned> PortSet<T> {
impl<T:Owned> GenericPort<T> for PortSet<T> {
fn try_recv(&self) -> Option<T> {
unsafe {
let mut self_ports = transmute_mut(&self.ports);
let self_ports = transmute_mut(&self.ports);
let mut result = None;
// we have to swap the ports array so we aren't borrowing
// aliasable mutable memory.
Expand Down Expand Up @@ -358,7 +355,7 @@ pub mod oneshot {
pub fn init<T: Owned>() -> (client::Oneshot<T>, server::Oneshot<T>) {
pub use core::pipes::HasBuffer;

let mut buffer = ~::core::pipes::Buffer {
let buffer = ~::core::pipes::Buffer {
header: ::core::pipes::BufferHeader(),
data: __Buffer {
Oneshot: ::core::pipes::mk_packet::<Oneshot<T>>()
Expand Down
1 change: 0 additions & 1 deletion src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ they contained the following prologue:
#[no_core];

#[deny(non_camel_case_types)];
#[allow(deprecated_mutable_fields)];

// Make core testable by not duplicating lang items. See #2912
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");
Expand Down
8 changes: 3 additions & 5 deletions src/libcore/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub fn send<T,Tbuffer>(mut p: SendPacketBuffered<T,Tbuffer>,
payload: T)
-> bool {
let header = p.header();
let mut p_ = p.unwrap();
let p_ = p.unwrap();
let p = unsafe { &mut *p_ };
assert!(ptr::to_unsafe_ptr(&(p.header)) == header);
assert!(p.payload.is_none());
Expand Down Expand Up @@ -404,10 +404,8 @@ a message, or `Some(T)` if a message was received.
*/
pub fn try_recv<T:Owned,Tbuffer:Owned>(mut p: RecvPacketBuffered<T, Tbuffer>)
-> Option<T> {
let mut p_ = p.unwrap();
let mut p = unsafe {
&mut *p_
};
let p_ = p.unwrap();
let p = unsafe { &mut *p_ };

do (|| {
try_recv_(p)
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
disr_val: int,
n_fields: uint,
name: &str) -> bool {
self.inner.push_ptr(); // NOTE remove after next snapshot
if ! self.inner.visit_enter_enum_variant(variant, disr_val,
n_fields, name) {
return false;
Expand All @@ -433,7 +432,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
n_fields, name) {
return false;
}
self.inner.pop_ptr(); // NOTE remove after next snapshot
true
}

Expand Down
6 changes: 2 additions & 4 deletions src/libcore/rt/uv/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ pub impl StreamWatcher {
extern fn close_cb(handle: *uvll::uv_stream_t) {
let mut stream_watcher: StreamWatcher = NativeHandle::from_native_handle(handle);
{
let mut data = get_watcher_data(&mut stream_watcher);
data.close_cb.swap_unwrap()();
get_watcher_data(&mut stream_watcher).close_cb.swap_unwrap()();
}
drop_watcher_data(&mut stream_watcher);
unsafe { free_handle(handle as *c_void) }
Expand Down Expand Up @@ -214,8 +213,7 @@ pub impl TcpWatcher {
assert!(get_watcher_data(self).connect_cb.is_none());
get_watcher_data(self).connect_cb = Some(cb);

let mut connect_watcher = ConnectRequest::new();
let connect_handle = connect_watcher.native_handle();
let connect_handle = ConnectRequest::new().native_handle();
match address {
Ipv4(*) => {
do ip4_as_uv_ip4(address) |addr| {
Expand Down
8 changes: 3 additions & 5 deletions src/libcore/rt/uvio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ impl Drop for UvEventLoop {
let self = unsafe {
transmute::<&UvEventLoop, &mut UvEventLoop>(self)
};
let mut uv_loop = self.uvio.uv_loop();
uv_loop.close();
self.uvio.uv_loop().close();
}
}

Expand Down Expand Up @@ -189,9 +188,8 @@ impl TcpListener for UvTcpListener {
let maybe_stream = if status.is_none() {
let mut server_stream_watcher = server_stream_watcher;
let mut loop_ = loop_from_watcher(&server_stream_watcher);
let mut client_tcp_watcher = TcpWatcher::new(&mut loop_);
let client_tcp_watcher = client_tcp_watcher.as_stream();
// XXX: Need's to be surfaced in interface
let client_tcp_watcher = TcpWatcher::new(&mut loop_).as_stream();
// XXX: Needs to be surfaced in interface
server_stream_watcher.accept(client_tcp_watcher);
Some(~UvStream::new(client_tcp_watcher))
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
/*##################################################################*
* Step 1. Get spawner's taskgroup info.
*##################################################################*/
let mut spawner_group: @@mut TCB =
let spawner_group: @@mut TCB =
match local_get(OldHandle(spawner), taskgroup_key!()) {
None => {
// Main task, doing first spawn ever. Lazily initialise
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

/*! See doc.rs for a thorough explanation of the borrow checker */

use core;
use core::prelude::*;

use mc = middle::mem_categorization;
Expand All @@ -22,6 +21,7 @@ use middle::dataflow::DataFlowOperator;
use util::common::stmt_set;
use util::ppaux::{note_and_explain_region, Repr};

use core;
use core::hashmap::{HashSet, HashMap};
use core::io;
use core::result::{Result};
Expand Down
2 changes: 0 additions & 2 deletions src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,6 @@ pub impl mem_categorization_ctxt {
}
}

/// The `field_id` parameter is the ID of the enclosing expression or
/// pattern. It is used to determine which variant of an enum is in use.
fn cat_field<N:ast_node>(&self,
node: N,
base_cmt: cmt,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use syntax::ast_util::{def_id_of_def, local_def};
use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
use syntax::ast_util::{Privacy, Public, Private};
use syntax::ast_util::{variant_visibility_to_privacy, visibility_to_privacy};
use syntax::attr::{attr_metas, contains_name, attrs_contains_name};
use syntax::attr::{attr_metas, contains_name};
use syntax::parse::token::ident_interner;
use syntax::parse::token::special_idents;
use syntax::print::pprust::path_to_str;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/typeck/infer/region_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,12 @@ use middle::typeck::infer::cres;
use util::common::indenter;
use util::ppaux::note_and_explain_region;

use core;
use core::cell::{Cell, empty_cell};
use core::hashmap::{HashMap, HashSet};
use core::to_bytes;
use core::uint;
use core::vec;
use core;
use syntax::codemap::span;
use syntax::ast;

Expand Down
Loading