}
+```
+"##,
+
+E0249: r##"
+This error indicates a constant expression for the array length was found, but
+it was not an integer (signed or unsigned) expression.
+
+Some examples of code that produces this error are:
+
+```
+const A: [u32; "hello"] = []; // error
+const B: [u32; true] = []; // error
+const C: [u32; 0.0] = []; // error
+"##,
+
+E0250: r##"
+This means there was an error while evaluating the expression for the length of
+a fixed-size array type.
+
+Some examples of code that produces this error are:
+
+```
+// divide by zero in the length expression
+const A: [u32; 1/0] = [];
+
+// Rust currently will not evaluate the function `foo` at compile time
+fn foo() -> usize { 12 }
+const B: [u32; foo()] = [];
+
+// it is an error to try to add `u8` and `f64`
+use std::{f64, u8};
+const C: [u32; u8::MAX + f64::EPSILON] = [];
+```
"##
}
@@ -164,18 +306,18 @@ register_diagnostics! {
E0030,
E0031,
E0033,
- E0034,
- E0035,
- E0036,
- E0038,
+ E0034, // multiple applicable methods in scope
+ E0035, // does not take type parameters
+ E0036, // incorrect number of type parameters given for this method
+ E0038, // cannot convert to a trait object because trait is not object-safe
E0040, // explicit use of destructor method
- E0044,
- E0045,
+ E0044, // foreign items may not have type parameters
+ E0045, // variadic function must have C calling convention
E0049,
E0050,
E0053,
- E0055,
- E0057,
+ E0055, // method has an incompatible type for trait
+ E0057, // method has an incompatible type for trait
E0059,
E0060,
E0061,
@@ -232,7 +374,6 @@ register_diagnostics! {
E0178,
E0182,
E0183,
- E0184,
E0185,
E0186,
E0187, // can't infer the kind of the closure
@@ -254,12 +395,6 @@ register_diagnostics! {
E0202, // associated items are not allowed in inherent impls
E0203, // type parameter has more than one relaxed default bound,
// and only one is supported
- E0204, // trait `Copy` may not be implemented for this type; field
- // does not implement `Copy`
- E0205, // trait `Copy` may not be implemented for this type; variant
- // does not implement `copy`
- E0206, // trait `Copy` may not be implemented for this type; type is
- // not a structure or enumeration
E0207, // type parameter is not constrained by the impl trait, self type, or predicate
E0208,
E0209, // builtin traits can only be implemented on structs or enums
@@ -296,14 +431,10 @@ register_diagnostics! {
E0240,
E0241,
E0242, // internal error looking up a definition
- E0243, // wrong number of type arguments
- E0244, // wrong number of type arguments
E0245, // not a trait
E0246, // illegal recursive type
E0247, // found module name used as a type
E0248, // found value name used as a type
- E0249, // expected constant expr for array length
- E0250, // expected constant expr for array length
E0318, // can't create default impls for traits outside their crates
E0319, // trait impls for defaulted traits allowed just for structs/enums
E0320, // recursive overflow during dropck
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 08792044c2a77..36cf650d54e9a 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -905,6 +905,8 @@ impl DocFolder for Cache {
// Index this method for searching later on
if let Some(ref s) = item.name {
let (parent, is_method) = match item.inner {
+ clean::AssociatedTypeItem(..) |
+ clean::AssociatedConstItem(..) |
clean::TyMethodItem(..) |
clean::StructFieldItem(..) |
clean::VariantItem(..) => {
@@ -1862,6 +1864,17 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
try!(write!(w, ""));
}
+ if !consts.is_empty() {
+ try!(write!(w, "
+ Associated Constants
+
+ "));
+ for t in &consts {
+ try!(trait_item(w, *t));
+ }
+ try!(write!(w, "
"));
+ }
+
// Output the documentation for each function individually
if !required.is_empty() {
try!(write!(w, "
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 6a1d7bdfd8358..932a536ab1887 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -34,7 +34,8 @@
"macro",
"primitive",
"associatedtype",
- "constant"];
+ "constant",
+ "associatedconstant"];
$('.js-only').removeClass('js-only');
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 21f873e687743..934b3156357d6 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1199,7 +1199,7 @@ impl Into for PathBuf {
/// absolute, and so on. More details about the overall approach can be found in
/// the module documentation.
///
-/// This is an *unsized* type, meaning that it must always be used with behind a
+/// This is an *unsized* type, meaning that it must always be used behind a
/// pointer like `&` or `Box`.
///
/// # Examples
diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs
index cd8d7ec16dce4..20d4c744414c6 100644
--- a/src/test/rustdoc/assoc-consts.rs
+++ b/src/test/rustdoc/assoc-consts.rs
@@ -13,6 +13,7 @@
pub trait Foo {
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
// 'const FOO: usize;'
+ // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO'
const FOO: usize;
}