]> git.lizzy.rs Git - rust.git/commitdiff
Fix type parameter default error to mention type and trait definitions
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Mon, 18 Jan 2016 12:45:35 +0000 (13:45 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Tue, 19 Jan 2016 11:38:24 +0000 (12:38 +0100)
Introduced in PR #30724, needs to mention that type parameter defaults
are legal in trait and type definitions too.

src/librustc_typeck/collect.rs

index eb204c5641495ed11d248ad1e4be8b3b80468a27..224565e713b60d670f878bada7362ad2e7aeb319 100644 (file)
@@ -1922,8 +1922,8 @@ fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
                 lint::builtin::INVALID_TYPE_PARAM_DEFAULT,
                 param.id,
                 param.span,
-                format!("defaults for type parameters are only allowed on type definitions, \
-                         like `struct` or `enum`"));
+                format!("defaults for type parameters are only allowed in `struct`, \
+                         `enum`, `type`, or `trait` definitions."));
         }
     }