about summary refs log tree commit diff
path: root/src/libcore/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-22 15:36:51 -0700
committerbors <bors@rust-lang.org>2013-04-22 15:36:51 -0700
commitaba93c6b60a91fc4b6b60408e51b23dbee5f44c9 (patch)
tree91d5ca30a8d1809161972cffa0b69b89a22750f2 /src/libcore/rt
parenta6dd7dc1f2e1057719179e861a5a5ae55d6a8335 (diff)
parentc389d0b0dd2273c9f7d16917a1738509f5522491 (diff)
downloadrust-aba93c6b60a91fc4b6b60408e51b23dbee5f44c9.tar.gz
rust-aba93c6b60a91fc4b6b60408e51b23dbee5f44c9.zip
auto merge of #5966 : alexcrichton/rust/issue-3083, r=graydon
Closes #3083.

This takes a similar approach to #5797 where a set is present on the `tcx` of used mutable definitions. Everything is by default warned about, and analyses must explicitly add mutable definitions to this set so they're not warned about.

Most of this was pretty straightforward, although there was one caveat that I ran into when implementing it. Apparently when the old modes are used (or maybe `legacy_modes`, I'm not sure) some different code paths are taken to cause spurious warnings to be issued which shouldn't be issued. I'm not really sure how modes even worked, so I was having a lot of trouble tracking this down. I figured that because they're a legacy thing that I'd just de-mode the compiler so that the warnings wouldn't be a problem anymore (or at least for the compiler).

Other than that, the entire compiler compiles without warnings of unused mutable variables. To prevent bad warnings, #5965 should be landed (which in turn is waiting on #5963) before landing this. I figured I'd stick it out for review anyway though.
Diffstat (limited to 'src/libcore/rt')
-rw-r--r--src/libcore/rt/uv/mod.rs2
-rw-r--r--src/libcore/rt/uv/net.rs2
-rw-r--r--src/libcore/rt/uvio.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/rt/uv/mod.rs b/src/libcore/rt/uv/mod.rs
index 32757d6376e..4cbc8d70569 100644
--- a/src/libcore/rt/uv/mod.rs
+++ b/src/libcore/rt/uv/mod.rs
@@ -402,7 +402,7 @@ fn loop_smoke_test() {
 fn idle_new_then_close() {
     do run_in_bare_thread {
         let mut loop_ = Loop::new();
-        let mut idle_watcher = { IdleWatcher::new(&mut loop_) };
+        let idle_watcher = { IdleWatcher::new(&mut loop_) };
         idle_watcher.close();
     }
 }
diff --git a/src/libcore/rt/uv/net.rs b/src/libcore/rt/uv/net.rs
index b4a08c14928..bcfe8b2cfdf 100644
--- a/src/libcore/rt/uv/net.rs
+++ b/src/libcore/rt/uv/net.rs
@@ -393,7 +393,7 @@ fn connect_read() {
                 let buf = vec_from_uv_buf(buf);
                 rtdebug!("read cb!");
                 if status.is_none() {
-                    let bytes = buf.unwrap();
+                    let _bytes = buf.unwrap();
                     rtdebug!("%s", bytes.slice(0, nread as uint).to_str());
                 } else {
                     rtdebug!("status after read: %s", status.get().to_str());
diff --git a/src/libcore/rt/uvio.rs b/src/libcore/rt/uvio.rs
index ff539739835..d4e547de383 100644
--- a/src/libcore/rt/uvio.rs
+++ b/src/libcore/rt/uvio.rs
@@ -206,7 +206,7 @@ impl TcpListener for UvTcpListener {
                     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 mut client_tcp_watcher = client_tcp_watcher.as_stream();
+                    let client_tcp_watcher = client_tcp_watcher.as_stream();
                     // XXX: Need's to be surfaced in interface
                     server_stream_watcher.accept(client_tcp_watcher);
                     Some(~UvStream::new(client_tcp_watcher))