about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-08-07 09:27:27 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-08-12 17:58:56 -0400
commit91b3e9cac0125e35d65169fb7e06166a078296c7 (patch)
tree9d4ee7d97b5ffeec38060a1afa9a386cb08f233d
parent788a802dad3f273b74150b732d24d37a695d29f6 (diff)
Fallout in libs -- misc missing bounds uncovered by WF checks.
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/marker.rs2
-rw-r--r--src/libcore/num/mod.rs4
-rw-r--r--src/libcore/str/mod.rs3
-rw-r--r--src/libgraphviz/lib.rs2
-rw-r--r--src/librand/distributions/range.rs3
-rw-r--r--src/librustc/middle/astencode.rs2
-rw-r--r--src/librustc/middle/expr_use_visitor.rs2
-rw-r--r--src/librustc_data_structures/unify/mod.rs2
-rw-r--r--src/libserialize/serialize.rs2
-rw-r--r--src/libstd/sync/mutex.rs2
-rw-r--r--src/libstd/thread/local.rs2
-rw-r--r--src/libstd/thread/scoped_tls.rs2
13 files changed, 16 insertions, 14 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 3382095b456..d19f3b6d27a 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2623,7 +2623,7 @@ impl<A, St, F> Iterator for Unfold<St, F> where F: FnMut(&mut St) -> Option<A> {
 /// two `Step` objects.
 #[unstable(feature = "step_trait",
            reason = "likely to be replaced by finer-grained traits")]
-pub trait Step: PartialOrd {
+pub trait Step: PartialOrd+Sized {
     /// Steps `self` if possible.
     fn step(&self, by: &Self) -> Option<Self>;
 
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index c0956753c98..32f367e12f0 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -56,7 +56,7 @@ pub trait Sized {
 /// Types that can be "unsized" to a dynamically sized type.
 #[unstable(feature = "unsize")]
 #[lang="unsize"]
-pub trait Unsize<T> {
+pub trait Unsize<T: ?Sized> {
     // Empty.
 }
 
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index ad891bf8fa6..7507e5782d6 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -19,7 +19,7 @@ use char::CharExt;
 use cmp::{Eq, PartialOrd};
 use fmt;
 use intrinsics;
-use marker::Copy;
+use marker::{Copy, Sized};
 use mem::size_of;
 use option::Option::{self, Some, None};
 use result::Result::{self, Ok, Err};
@@ -1264,7 +1264,7 @@ pub enum FpCategory {
 #[doc(hidden)]
 #[unstable(feature = "core_float",
            reason = "stable interface is via `impl f{32,64}` in later crates")]
-pub trait Float {
+pub trait Float: Sized {
     /// Returns the NaN value.
     fn nan() -> Self;
     /// Returns the infinite value.
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 3c9338c2cd2..d5bceb3ba62 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -25,6 +25,7 @@ use default::Default;
 use fmt;
 use iter::ExactSizeIterator;
 use iter::{Map, Iterator, DoubleEndedIterator};
+use marker::Sized;
 use mem;
 use ops::{Fn, FnMut, FnOnce};
 use option::Option::{self, None, Some};
@@ -37,7 +38,7 @@ pub mod pattern;
 /// A trait to abstract the idea of creating a new instance of a type from a
 /// string.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub trait FromStr {
+pub trait FromStr: Sized {
     /// The associated error which can be returned from parsing.
     #[stable(feature = "rust1", since = "1.0.0")]
     type Err;
diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs
index f6f3438f467..a0b571b65ab 100644
--- a/src/libgraphviz/lib.rs
+++ b/src/libgraphviz/lib.rs
@@ -561,7 +561,7 @@ pub type Edges<'a,E> = Cow<'a,[E]>;
 /// `Cow<[T]>` to leave implementers the freedom to create
 /// entirely new vectors or to pass back slices into internally owned
 /// vectors.
-pub trait GraphWalk<'a, N, E> {
+pub trait GraphWalk<'a, N: Clone, E: Clone> {
     /// Returns all the nodes in this graph.
     fn nodes(&'a self) -> Nodes<'a, N>;
     /// Returns all of the edges in this graph.
diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs
index e196708368a..26f92ee3b1c 100644
--- a/src/librand/distributions/range.rs
+++ b/src/librand/distributions/range.rs
@@ -12,6 +12,7 @@
 
 // this is surprisingly complicated to be both generic & correct
 
+use core::marker::Sized;
 use Rng;
 use distributions::{Sample, IndependentSample};
 
@@ -57,7 +58,7 @@ impl<Sup: SampleRange> IndependentSample<Sup> for Range<Sup> {
 /// uniformly between two values. This should not be used directly,
 /// and is only to facilitate `Range`.
 #[doc(hidden)]
-pub trait SampleRange {
+pub trait SampleRange: Sized {
     /// Construct the `Range` object that `sample_range`
     /// requires. This should not ever be called directly, only via
     /// `Range::new`, which will check that `low < high`, so this
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index 5c3b0a1c2d2..c064b31173f 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -1061,7 +1061,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
     }
 }
 
-trait doc_decoder_helpers {
+trait doc_decoder_helpers: Sized {
     fn as_int(&self) -> isize;
     fn opt_child(&self, tag: c::astencode_tag) -> Option<Self>;
 }
diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs
index 3755b4c57c3..a97fe84e6ac 100644
--- a/src/librustc/middle/expr_use_visitor.rs
+++ b/src/librustc/middle/expr_use_visitor.rs
@@ -239,7 +239,7 @@ impl OverloadedCallType {
 // supplies types from the tree. After type checking is complete, you
 // can just use the tcx as the typer.
 
-pub struct ExprUseVisitor<'d,'t,'a: 't, 'tcx:'a> {
+pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
     typer: &'t infer::InferCtxt<'a, 'tcx>,
     mc: mc::MemCategorizationContext<'t, 'a, 'tcx>,
     delegate: &'d mut (Delegate<'tcx>+'d),
diff --git a/src/librustc_data_structures/unify/mod.rs b/src/librustc_data_structures/unify/mod.rs
index 7582b7ff61d..4d79b1a64c1 100644
--- a/src/librustc_data_structures/unify/mod.rs
+++ b/src/librustc_data_structures/unify/mod.rs
@@ -272,7 +272,7 @@ impl<'tcx,K> UnificationTable<K>
 
 impl<'tcx,K,V> UnificationTable<K>
     where K: UnifyKey<Value=Option<V>>,
-          V: Clone+PartialEq,
+          V: Clone+PartialEq+Debug,
 {
     pub fn unify_var_var(&mut self,
                          a_id: K,
diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs
index af138734610..5e96ec6ab0d 100644
--- a/src/libserialize/serialize.rs
+++ b/src/libserialize/serialize.rs
@@ -194,7 +194,7 @@ pub trait Encodable {
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>;
 }
 
-pub trait Decodable {
+pub trait Decodable: Sized {
     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
 }
 
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index 4b62434d068..773bd7f5606 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -369,7 +369,7 @@ mod tests {
     use sync::{Arc, Mutex, StaticMutex, Condvar};
     use thread;
 
-    struct Packet<T: Send>(Arc<(Mutex<T>, Condvar)>);
+    struct Packet<T>(Arc<(Mutex<T>, Condvar)>);
 
     unsafe impl<T: Send> Send for Packet<T> {}
     unsafe impl<T> Sync for Packet<T> {}
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 3bf170b5fe2..a228cbfd85b 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -60,7 +60,7 @@ pub use self::imp::Key as __KeyInner;
 /// });
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]
-pub struct LocalKey<T> {
+pub struct LocalKey<T:'static> {
     // The key itself may be tagged with #[thread_local], and this `Key` is
     // stored as a `static`, and it's not valid for a static to reference the
     // address of another thread_local static. For this reason we kinda wonkily
diff --git a/src/libstd/thread/scoped_tls.rs b/src/libstd/thread/scoped_tls.rs
index 303ab0f9f01..810e3bb62f7 100644
--- a/src/libstd/thread/scoped_tls.rs
+++ b/src/libstd/thread/scoped_tls.rs
@@ -55,7 +55,7 @@ pub use self::imp::KeyInner as __KeyInner;
 #[unstable(feature = "scoped_tls",
            reason = "scoped TLS has yet to have wide enough use to fully consider \
                      stabilizing its interface")]
-pub struct ScopedKey<T> { inner: fn() -> &'static imp::KeyInner<T> }
+pub struct ScopedKey<T:'static> { inner: fn() -> &'static imp::KeyInner<T> }
 
 /// Declare a new scoped thread local storage key.
 ///