diff --git a/src/doc/complement-design-faq.md b/src/doc/complement-design-faq.md index 952416ac160e1..1a0155d4773ec 100644 --- a/src/doc/complement-design-faq.md +++ b/src/doc/complement-design-faq.md @@ -39,7 +39,7 @@ representation as a primitive. This allows using Rust `enum`s in FFI where C `enum`s are also used, for most use cases. The attribute can also be applied to `struct`s to get the same layout as a C struct would. -[repr]: reference.html#miscellaneous-attributes +[repr]: reference.html#ffi-attributes ## There is no GC diff --git a/src/doc/reference.md b/src/doc/reference.md index 8103ce8f7f6cc..ac65b93445572 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -1867,13 +1867,12 @@ macro scope. lower to the target's SIMD instructions, if any; the `simd` feature gate is necessary to use this attribute. - `static_assert` - on statics whose type is `bool`, terminates compilation - with an error if it is not initialized to `true`. -- `unsafe_destructor` - allow implementations of the "drop" language item - where the type it is implemented for does not implement the "send" language - item; the `unsafe_destructor` feature gate is needed to use this attribute + with an error if it is not initialized to `true`. To use this, the `static_assert` + feature gate must be enabled. - `unsafe_no_drop_flag` - on structs, remove the flag that prevents destructors from being run twice. Destructors might be run multiple times on - the same object with this attribute. + the same object with this attribute. To use this, the `unsafe_no_drop_flag` feature + gate must be enabled. - `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`. - `rustc_on_unimplemented` - Write a custom note to be shown along with the error when the trait is found to be unimplemented on a type. diff --git a/src/doc/trpl/guessing-game.md b/src/doc/trpl/guessing-game.md index 431b7dc50a299..f11ec9b9e7681 100644 --- a/src/doc/trpl/guessing-game.md +++ b/src/doc/trpl/guessing-game.md @@ -82,11 +82,11 @@ fn main() { let mut guess = String::new(); - let input = io::stdin().read_line(&mut guess) + io::stdin().read_line(&mut guess) .ok() .expect("Failed to read line"); - println!("You guessed: {}", input); + println!("You guessed: {}", guess); } ``` @@ -302,12 +302,12 @@ project. There’s just one line of this first example left: ```rust,ignore - println!("You guessed: {}", input); + println!("You guessed: {}", guess); } ``` This prints out the string we saved our input in. The `{}`s are a placeholder, -and so we pass it `input` as an argument. If we had multiple `{}`s, we would +and so we pass it `guess` as an argument. If we had multiple `{}`s, we would pass multiple arguments: ```rust @@ -410,11 +410,11 @@ $ cargo build Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game) ``` -So, we told Cargo we wanted any version of `rand`, and so it fetched the -latest version at the time this was written, `v0.3.8`. But what happens -when next week, version `v0.4.0` comes out, which changes something with -`rand`, and it includes a breaking change? After all, a `v0.y.z` version -in SemVer can change every release. +So, we told Cargo we wanted any version of `rand`, and so it fetched the latest +version at the time this was written, `v0.3.8`. But what happens when next +week, version `v0.3.9` comes out, with an important bugfix? While getting +bugfixes is important, what if `0.3.9` contains a regression that breaks our +code? The answer to this problem is the `Cargo.lock` file you’ll now find in your project directory. When you build your project for the first time, Cargo @@ -422,12 +422,17 @@ figures out all of the versions that fit your criteria, and then writes them to the `Cargo.lock` file. When you build your project in the future, Cargo will see that the `Cargo.lock` file exists, and then use that specific version rather than do all the work of figuring out versions again. This lets you -have a repeatable build automatically. +have a repeatable build automatically. In other words, we’ll stay at `0.3.8` +until we explicitly upgrade, and so will anyone who we share our code with, +thanks to the lock file. -What about when we _do_ want to use `v0.4.0`? Cargo has another command, +What about when we _do_ want to use `v0.3.9`? Cargo has another command, `update`, which says ‘ignore the lock, figure out all the latest versions that fit what we’ve specified. If that works, write those versions out to the lock -file’. +file’. But, by default, Cargo will only look for versions larger than `0.3.0` +and smaller than `0.4.0`. If we want to move to `0.4.x`, we’d have to update +the `Cargo.toml` directly. When we do, the next time we `cargo build`, Cargo +will update the index and re-evaluate our `rand` requirements. There’s a lot more to say about [Cargo][doccargo] and [its ecosystem][doccratesio], but for now, that’s all we need to know. Cargo makes @@ -960,8 +965,6 @@ fn main() { let secret_number = rand::thread_rng().gen_range(1, 101); - println!("The secret number is: {}", secret_number); - loop { println!("Please input your guess."); diff --git a/src/doc/trpl/strings.md b/src/doc/trpl/strings.md index 6ed4c7cb1b379..61a6ec3eb3f4d 100644 --- a/src/doc/trpl/strings.md +++ b/src/doc/trpl/strings.md @@ -73,13 +73,13 @@ individual bytes, or as codepoints: let hachiko = "忠犬ハチ公"; for b in hachiko.as_bytes() { -print!("{}, ", b); + print!("{}, ", b); } println!(""); for c in hachiko.chars() { -print!("{}, ", c); + print!("{}, ", c); } println!(""); diff --git a/src/grammar/RustLexer.g4 b/src/grammar/RustLexer.g4 index 3d8f3aeb28fa7..f062d33f25e25 100644 --- a/src/grammar/RustLexer.g4 +++ b/src/grammar/RustLexer.g4 @@ -8,14 +8,14 @@ lexer grammar RustLexer; tokens { - EQ, LT, LE, EQEQ, NE, GE, GT, ANDAND, OROR, NOT, TILDE, PLUT, + EQ, LT, LE, EQEQ, NE, GE, GT, ANDAND, OROR, NOT, TILDE, PLUS, MINUS, STAR, SLASH, PERCENT, CARET, AND, OR, SHL, SHR, BINOP, BINOPEQ, AT, DOT, DOTDOT, DOTDOTDOT, COMMA, SEMI, COLON, MOD_SEP, RARROW, FAT_ARROW, LPAREN, RPAREN, LBRACKET, RBRACKET, - LBRACE, RBRACE, POUND, DOLLAR, UNDERSCORE, LIT_CHAR, + LBRACE, RBRACE, POUND, DOLLAR, UNDERSCORE, LIT_CHAR, LIT_BYTE, LIT_INTEGER, LIT_FLOAT, LIT_STR, LIT_STR_RAW, LIT_BINARY, - LIT_BINARY_RAW, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT, - COMMENT, SHEBANG + LIT_BINARY_RAW, QUESTION, IDENT, LIFETIME, WHITESPACE, DOC_COMMENT, + COMMENT, SHEBANG, UTF8_BOM } import xidstart , xidcontinue; diff --git a/src/grammar/verify.rs b/src/grammar/verify.rs index dec797747c270..10b8abfc78606 100644 --- a/src/grammar/verify.rs +++ b/src/grammar/verify.rs @@ -111,7 +111,7 @@ fn parse_token_list(file: &str) -> HashMap { "LIT_BINARY_RAW" => token::Literal(token::BinaryRaw(Name(0), 0), None), "QUESTION" => token::Question, "SHEBANG" => token::Shebang(Name(0)), - _ => continue, + _ => panic!("Bad token str `{}`", val), }; res.insert(num.to_string(), tok); diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 7a089d733cfdf..a0d60be300059 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -37,7 +37,7 @@ //! } //! ``` //! -//! This will print `Cons(1, Box(Cons(2, Box(Nil))))`. +//! This will print `Cons(1, Cons(2, Nil))`. //! //! Recursive structures must be boxed, because if the definition of `Cons` looked like this: //! diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 24d9c9a7e7ce7..a787d34f9145a 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -602,6 +602,8 @@ pub trait Iterator { /// Performs a fold operation over the entire iterator, returning the /// eventual state at the end of the iteration. /// + /// This operation is sometimes called 'reduce' or 'inject'. + /// /// # Examples /// /// ``` diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 4cbc3b4725d3b..6ee4ee4818131 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -3624,6 +3624,30 @@ pub mod consts { pub const IPV6_DROP_MEMBERSHIP: c_int = 21; pub const TCP_NODELAY: c_int = 1; + pub const TCP_MAXSEG: c_int = 2; + pub const TCP_CORK: c_int = 3; + pub const TCP_KEEPIDLE: c_int = 4; + pub const TCP_KEEPINTVL: c_int = 5; + pub const TCP_KEEPCNT: c_int = 6; + pub const TCP_SYNCNT: c_int = 7; + pub const TCP_LINGER2: c_int = 8; + pub const TCP_DEFER_ACCEPT: c_int = 9; + pub const TCP_WINDOW_CLAMP: c_int = 10; + pub const TCP_INFO: c_int = 11; + pub const TCP_QUICKACK: c_int = 12; + pub const TCP_CONGESTION: c_int = 13; + pub const TCP_MD5SIG: c_int = 14; + pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; + pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16; + pub const TCP_THIN_DUPACK: c_int = 17; + pub const TCP_USER_TIMEOUT: c_int = 18; + pub const TCP_REPAIR: c_int = 19; + pub const TCP_REPAIR_QUEUE: c_int = 20; + pub const TCP_QUEUE_SEQ: c_int = 21; + pub const TCP_REPAIR_OPTIONS: c_int = 22; + pub const TCP_FASTOPEN: c_int = 23; + pub const TCP_TIMESTAMP: c_int = 24; + pub const SOL_SOCKET: c_int = 65535; pub const SO_DEBUG: c_int = 0x0001; diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 19d2df0b486cf..88112b4b90cbe 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -419,6 +419,74 @@ of a loop. Without a loop to break out of or continue in, no sensible action can be taken. "##, +E0282: r##" +This error indicates that type inference did not result in one unique possible +type, and extra information is required. In most cases this can be provided +by adding a type annotation. Sometimes you need to specify a generic type +parameter manually. + +A common example is the `collect` method on `Iterator`. It has a generic type +parameter with a `FromIterator` bound, which for a `char` iterator is +implemented by `Vec` and `String` among others. Consider the following snippet +that reverses the characters of a string: + +``` +let x = "hello".chars().rev().collect(); +``` + +In this case, the compiler cannot infer what the type of `x` should be: +`Vec` and `String` are both suitable candidates. To specify which type to +use, you can use a type annotation on `x`: + +``` +let x: Vec = "hello".chars().rev().collect(); +``` + +It is not necessary to annotate the full type. Once the ambiguity is resolved, +the compiler can infer the rest: + +``` +let x: Vec<_> = "hello".chars().rev().collect(); +``` + +Another way to provide the compiler with enough information, is to specify the +generic type parameter: + +``` +let x = "hello".chars().rev().collect::>(); +``` + +Again, you need not specify the full type if the compiler can infer it: + +``` +let x = "hello".chars().rev().collect::>(); +``` + +Apart from a method or function with a generic type parameter, this error can +occur when a type parameter of a struct or trait cannot be inferred. In that +case it is not always possible to use a type annotation, because all candidates +have the same return type. For instance: + +``` +struct Foo { + // Some fields omitted. +} + +impl Foo { + fn bar() -> i32 { + 0 + } + + fn baz() { + let number = Foo::bar(); + } +} +``` + +This will fail because the compiler does not know which instance of `Foo` to +call `bar` on. Change `Foo::bar()` to `Foo::::bar()` to resolve the error. +"##, + E0296: r##" This error indicates that the given recursion limit could not be parsed. Ensure that the value provided is a positive integer between quotes, like so: @@ -524,10 +592,65 @@ number cannot be negative. E0307: r##" The length of an array is part of its type. For this reason, this length must be a compile-time constant. +"##, + +E0308: r##" +This error occurs when the compiler was unable to infer the concrete type of a +variable. This error can occur for several cases, the most common of which is a +mismatch in the expected type that the compiler inferred for a variable's +initializing expression, and the actual type explicitly assigned to the +variable. + +For example: + +let x: i32 = "I am not a number!"; +// ~~~ ~~~~~~~~~~~~~~~~~~~~ +// | | +// | initializing expression; +// | compiler infers type `&str` +// | +// type `i32` assigned to variable `x` +"##, + +E0309: r##" +Types in type definitions have lifetimes associated with them that represent +how long the data stored within them is guaranteed to be live. This lifetime +must be as long as the data needs to be alive, and missing the constraint that +denotes this will cause this error. + +// This won't compile because T is not constrained, meaning the data +// stored in it is not guaranteed to last as long as the reference +struct Foo<'a, T> { + foo: &'a T +} + +// This will compile, because it has the constraint on the type parameter +struct Foo<'a, T: 'a> { + foo: &'a T +} +"##, + +E0310: r##" +Types in type definitions have lifetimes associated with them that represent +how long the data stored within them is guaranteed to be live. This lifetime +must be as long as the data needs to be alive, and missing the constraint that +denotes this will cause this error. + +// This won't compile because T is not constrained to the static lifetime +// the reference needs +struct Foo { + foo: &'static T +} + +// This will compile, because it has the constraint on the type parameter +struct Foo { + foo: &'static T +} "## } + register_diagnostics! { E0011, E0012, @@ -562,7 +685,6 @@ register_diagnostics! { E0279, // requirement is not satisfied E0280, // requirement is not satisfied E0281, // type implements trait but other trait is required - E0282, // unable to infer enough type information about E0283, // cannot resolve type E0284, // cannot resolve type E0285, // overflow evaluation builtin bounds @@ -571,9 +693,6 @@ register_diagnostics! { E0300, // unexpanded macro E0304, // expected signed integer constant E0305, // expected constant - E0308, - E0309, // thing may not live long enough - E0310, // thing may not live long enough E0311, // thing may not live long enough E0312, // lifetime of reference outlives lifetime of borrowed content E0313, // lifetime of borrowed pointer outlives lifetime of captured variable diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 6f40e17855a78..e7a03a9b7e174 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -374,7 +374,7 @@ fn extract_labels<'v, 'a>(ctxt: &mut LifetimeContext<'a>, b: &'v ast::Block) { fn visit_expr(&mut self, ex: &'v ast::Expr) { if let Some(label) = expression_label(ex) { for &(prior, prior_span) in &self.labels_in_fn[..] { - // FIXME (#24278): non-hygienic comparision + // FIXME (#24278): non-hygienic comparison if label.name == prior.name { signal_shadowing_problem(self.sess, label.name, @@ -420,7 +420,7 @@ fn extract_labels<'v, 'a>(ctxt: &mut LifetimeContext<'a>, b: &'v ast::Block) { EarlyScope(_, lifetimes, s) | LateScope(lifetimes, s) => { for lifetime_def in lifetimes { - // FIXME (#24278): non-hygienic comparision + // FIXME (#24278): non-hygienic comparison if label.name == lifetime_def.lifetime.name { signal_shadowing_problem( sess, @@ -677,7 +677,7 @@ impl<'a> LifetimeContext<'a> { lifetime: &ast::Lifetime) { for &(label, label_span) in &self.labels_in_fn { - // FIXME (#24278): non-hygienic comparision + // FIXME (#24278): non-hygienic comparison if lifetime.name == label.name { signal_shadowing_problem(self.sess, lifetime.name, diff --git a/src/librustc/middle/traits/error_reporting.rs b/src/librustc/middle/traits/error_reporting.rs index 1b5719d3d42e5..c2c4d60a4ff6e 100644 --- a/src/librustc/middle/traits/error_reporting.rs +++ b/src/librustc/middle/traits/error_reporting.rs @@ -290,7 +290,7 @@ pub fn maybe_report_ambiguity<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>, { span_err!(infcx.tcx.sess, obligation.cause.span, E0282, "unable to infer enough type information about `{}`; \ - type annotations required", + type annotations or generic parameter binding required", self_ty.user_string(infcx.tcx)); } else { span_err!(infcx.tcx.sess, obligation.cause.span, E0283, diff --git a/src/librustc_trans/trans/cleanup.rs b/src/librustc_trans/trans/cleanup.rs index 637325881436d..d23543924dd39 100644 --- a/src/librustc_trans/trans/cleanup.rs +++ b/src/librustc_trans/trans/cleanup.rs @@ -507,23 +507,6 @@ impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> { self.schedule_clean(cleanup_scope, drop as CleanupObj); } - /// Schedules a call to `free(val)`. Note that this is a shallow operation. - fn schedule_free_slice(&self, - cleanup_scope: ScopeId, - val: ValueRef, - size: ValueRef, - align: ValueRef, - heap: Heap) { - let drop = box FreeSlice { ptr: val, size: size, align: align, heap: heap }; - - debug!("schedule_free_slice({:?}, val={}, heap={:?})", - cleanup_scope, - self.ccx.tn().val_to_string(val), - heap); - - self.schedule_clean(cleanup_scope, drop as CleanupObj); - } - fn schedule_clean(&self, cleanup_scope: ScopeId, cleanup: CleanupObj<'tcx>) { @@ -1106,43 +1089,6 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> { } } -#[derive(Copy, Clone)] -pub struct FreeSlice { - ptr: ValueRef, - size: ValueRef, - align: ValueRef, - heap: Heap, -} - -impl<'tcx> Cleanup<'tcx> for FreeSlice { - fn must_unwind(&self) -> bool { - true - } - - fn clean_on_unwind(&self) -> bool { - true - } - - fn is_lifetime_end(&self) -> bool { - false - } - - fn trans<'blk>(&self, - bcx: Block<'blk, 'tcx>, - debug_loc: DebugLoc) - -> Block<'blk, 'tcx> { - match self.heap { - HeapExchange => { - glue::trans_exchange_free_dyn(bcx, - self.ptr, - self.size, - self.align, - debug_loc) - } - } - } -} - #[derive(Copy, Clone)] pub struct LifetimeEnd { ptr: ValueRef, @@ -1253,12 +1199,6 @@ pub trait CleanupMethods<'blk, 'tcx> { val: ValueRef, heap: Heap, content_ty: Ty<'tcx>); - fn schedule_free_slice(&self, - cleanup_scope: ScopeId, - val: ValueRef, - size: ValueRef, - align: ValueRef, - heap: Heap); fn schedule_clean(&self, cleanup_scope: ScopeId, cleanup: CleanupObj<'tcx>); diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 694993cdc0aae..677254238c034 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1344,7 +1344,7 @@ pub fn ast_ty_arg_to_ty<'tcx>(this: &AstConv<'tcx>, } // Check the base def in a PathResolution and convert it to a Ty. If there are -// associated types in the PathResolution, these will need to be seperately +// associated types in the PathResolution, these will need to be separately // resolved. fn base_def_to_ty<'tcx>(this: &AstConv<'tcx>, rscope: &RegionScope, diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 1e6e9a7562a7c..444e5dea89a46 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -944,7 +944,7 @@ impl<'a, 'tcx> Clean for (&'a ty::Generics<'tcx>, // a Sized bound, removing the bounds as we find them. // // Note that associated types also have a sized bound by default, but we - // don't actually konw the set of associated types right here so that's + // don't actually know the set of associated types right here so that's // handled in cleaning associated types let mut sized_params = HashSet::new(); where_predicates.retain(|pred| { diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index a53884ca047d1..798cc6a612cde 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -111,6 +111,10 @@ r##" trait, typedef (or tdef).

+

+ Search functions by type signature (e.g. + vec -> usize) +

diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs index adce5f22ebc10..9589f4cf099b2 100644 --- a/src/libstd/os/linux/raw.rs +++ b/src/libstd/os/linux/raw.rs @@ -60,8 +60,8 @@ mod arch { #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] mod arch { - use super::{dev_t, mode_t}; - use os::raw::c_long; + use super::mode_t; + use os::raw::{c_long, c_ulong}; use os::unix::raw::{gid_t, uid_t}; pub type blkcnt_t = i32; diff --git a/src/libstd/sys/unix/process2.rs b/src/libstd/sys/unix/process2.rs index 4e7c4d241f532..6f3c0fd63aa6d 100644 --- a/src/libstd/sys/unix/process2.rs +++ b/src/libstd/sys/unix/process2.rs @@ -328,7 +328,7 @@ impl Process { }) { Ok(0) => None, Ok(n) if n == self.pid => Some(translate_status(status)), - Ok(n) => panic!("unkown pid: {}", n), + Ok(n) => panic!("unknown pid: {}", n), Err(e) => panic!("unknown waitpid error: {}", e), } } diff --git a/src/rt/valgrind/valgrind.h b/src/rt/valgrind/valgrind.h index af01dfd71a71c..51f9de8edf057 100644 --- a/src/rt/valgrind/valgrind.h +++ b/src/rt/valgrind/valgrind.h @@ -5122,7 +5122,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) /* These requests allow control to move from the simulated CPU to the - real CPU, calling an arbitary function. + real CPU, calling an arbitrary function. Note that the current ThreadId is inserted as the first argument. So this call: diff --git a/src/test/compile-fail/issue-12187-1.rs b/src/test/compile-fail/issue-12187-1.rs index 74423b041dda3..5322966ae2ea0 100644 --- a/src/test/compile-fail/issue-12187-1.rs +++ b/src/test/compile-fail/issue-12187-1.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -14,5 +14,5 @@ fn new() -> &'static T { fn main() { let &v = new(); - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/issue-12187-2.rs b/src/test/compile-fail/issue-12187-2.rs index af5c8b45a483e..dabc0acba370e 100644 --- a/src/test/compile-fail/issue-12187-2.rs +++ b/src/test/compile-fail/issue-12187-2.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -14,5 +14,5 @@ fn new<'r, T>() -> &'r T { fn main() { let &v = new(); - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/issue-5062.rs b/src/test/compile-fail/issue-5062.rs index 7bf3449a664b1..392d38a6144f1 100644 --- a/src/test/compile-fail/issue-5062.rs +++ b/src/test/compile-fail/issue-5062.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -9,4 +9,4 @@ // except according to those terms. fn main() { format!("{:?}", None); } - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required diff --git a/src/test/compile-fail/issue-6458-2.rs b/src/test/compile-fail/issue-6458-2.rs index 0143c75bfc604..acf1d766b6a11 100644 --- a/src/test/compile-fail/issue-6458-2.rs +++ b/src/test/compile-fail/issue-6458-2.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -11,5 +11,5 @@ fn main() { // Unconstrained type: format!("{:?}", None); - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/issue-6458-3.rs b/src/test/compile-fail/issue-6458-3.rs index f96faeeec4bd1..3f81e51efe2ef 100644 --- a/src/test/compile-fail/issue-6458-3.rs +++ b/src/test/compile-fail/issue-6458-3.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -12,5 +12,5 @@ use std::mem; fn main() { mem::transmute(0); - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/issue-6458-4.rs b/src/test/compile-fail/issue-6458-4.rs index 02274e5441e26..7f408be9c02d4 100644 --- a/src/test/compile-fail/issue-6458-4.rs +++ b/src/test/compile-fail/issue-6458-4.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,7 +10,7 @@ fn foo(b: bool) -> Result { Err("bar".to_string()); - //~^ ERROR type annotations required + //~^ ERROR type annotations or generic parameter binding required } fn main() { diff --git a/src/test/compile-fail/issue-6458.rs b/src/test/compile-fail/issue-6458.rs index 0bf9a3c2d4867..c1f9dd6a4b893 100644 --- a/src/test/compile-fail/issue-6458.rs +++ b/src/test/compile-fail/issue-6458.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -16,7 +16,8 @@ pub struct MyState; pub fn foo(_: TypeWithState) {} pub fn bar() { - foo(TypeWithState(marker::PhantomData)); //~ ERROR type annotations required + foo(TypeWithState(marker::PhantomData)); + //~^ ERROR type annotations or generic parameter binding required } fn main() { diff --git a/src/test/compile-fail/issue-7813.rs b/src/test/compile-fail/issue-7813.rs index 81421af4fa839..327fb6adf1d54 100644 --- a/src/test/compile-fail/issue-7813.rs +++ b/src/test/compile-fail/issue-7813.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,5 +10,5 @@ fn main() { let v = &[]; - let it = v.iter(); //~ ERROR type annotations required + let it = v.iter(); //~ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs b/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs index c6d45f1c9db8a..59d75c5a787a6 100644 --- a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs +++ b/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -31,7 +31,8 @@ impl foo for Vec { fn m1() { // we couldn't infer the type of the vector just based on calling foo()... - let mut x = Vec::new(); //~ ERROR type annotations required + let mut x = Vec::new(); + //~^ ERROR type annotations or generic parameter binding required x.foo(); } diff --git a/src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs b/src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs index 8fe1f4d2371c4..c77494912bc75 100644 --- a/src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs +++ b/src/test/compile-fail/traits-multidispatch-convert-ambig-dest.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -33,7 +33,8 @@ where T : Convert } fn a() { - test(22, std::default::Default::default()); //~ ERROR type annotations required + test(22, std::default::Default::default()); + //~^ ERROR type annotations or generic parameter binding required } fn main() {} diff --git a/src/test/compile-fail/unconstrained-none.rs b/src/test/compile-fail/unconstrained-none.rs index 9879766a8fa25..c14de98e03f14 100644 --- a/src/test/compile-fail/unconstrained-none.rs +++ b/src/test/compile-fail/unconstrained-none.rs @@ -1,4 +1,4 @@ -// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -11,5 +11,5 @@ // Issue #5062 fn main() { - None; //~ ERROR type annotations required + None; //~ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/unconstrained-ref.rs b/src/test/compile-fail/unconstrained-ref.rs index e03f60e758ce2..02a3f2b9ab8d2 100644 --- a/src/test/compile-fail/unconstrained-ref.rs +++ b/src/test/compile-fail/unconstrained-ref.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -13,5 +13,5 @@ struct S<'a, T:'a> { } fn main() { - S { o: &None }; //~ ERROR type annotations required + S { o: &None }; //~ ERROR type annotations or generic parameter binding required } diff --git a/src/test/compile-fail/vector-no-ann.rs b/src/test/compile-fail/vector-no-ann.rs index d48f5715ec1b9..419b8c4e1b015 100644 --- a/src/test/compile-fail/vector-no-ann.rs +++ b/src/test/compile-fail/vector-no-ann.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -10,5 +10,6 @@ fn main() { - let _foo = Vec::new(); //~ ERROR type annotations required + let _foo = Vec::new(); + //~^ ERROR type annotations or generic parameter binding required } diff --git a/src/test/run-pass/issue-20616.rs b/src/test/run-pass/issue-20616.rs index e6b256f7e8413..d5b799710941b 100644 --- a/src/test/run-pass/issue-20616.rs +++ b/src/test/run-pass/issue-20616.rs @@ -32,7 +32,7 @@ type TypeF = Box; // type argument with trailing comma type TypeG = Box; -// trailing comma on liftime defs +// trailing comma on lifetime defs type TypeH<'a,> = &'a (); // trailing comma on type argument