From 48aea41adbae76759c1b56e145ce4b46675586a1 Mon Sep 17 00:00:00 2001 From: Carlos Galarza Date: Wed, 1 Apr 2015 10:16:36 -0500 Subject: [PATCH 01/17] Fix sidebar bug Validate if the description is available in the rawSearchIndex --- src/librustdoc/html/static/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index ca6d944195777..4f8488cca682b 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -713,10 +713,12 @@ if (crates[i] == window.currentCrate) { klass += ' current'; } - var desc = rawSearchIndex[crates[i]].items[0][3]; - div.append($('', {'href': '../' + crates[i] + '/index.html', - 'title': plainSummaryLine(desc), - 'class': klass}).text(crates[i])); + if (rawSearchIndex[crates[i]].items[0]) { + var desc = rawSearchIndex[crates[i]].items[0][3]; + div.append($('', {'href': '../' + crates[i] + '/index.html', + 'title': plainSummaryLine(desc), + 'class': klass}).text(crates[i])); + } } sidebar.append(div); } From 1cbaf9fd18a4e99345f3ae6d7ba23309e214e32a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 2 Apr 2015 11:31:31 -0700 Subject: [PATCH 02/17] Upgrade rust-installer --- src/rust-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust-installer b/src/rust-installer index 49cc7f6fef12b..ebc6b04c29591 160000 --- a/src/rust-installer +++ b/src/rust-installer @@ -1 +1 @@ -Subproject commit 49cc7f6fef12bdd77a0f8b182d9a64c371cb17c8 +Subproject commit ebc6b04c29591108d3f28e724b4b9b74cd1232e6 From 5a700b26e8cffee1d1ffbebf6d58a25a0cda1a41 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Thu, 2 Apr 2015 15:08:10 -0700 Subject: [PATCH 03/17] liballoc: fix typo --- src/liballoc/arc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index f87c450eda5ed..c07a6063d1475 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -446,7 +446,7 @@ impl Weak { /// ``` pub fn upgrade(&self) -> Option> { // We use a CAS loop to increment the strong count instead of a - // fetch_add because once the count hits 0 is must never be above 0. + // fetch_add because once the count hits 0 it must never be above 0. let inner = self.inner(); loop { let n = inner.strong.load(SeqCst); From e1be69b8a97d48d579b5474907aab9199d1b8ab7 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 3 Apr 2015 05:56:27 +0300 Subject: [PATCH 04/17] Add tests for parsing of patterns --- .../pat-lt-bracket-1.rs} | 0 .../pat-lt-bracket-2.rs} | 0 .../pat-lt-bracket-3.rs} | 0 src/test/parse-fail/pat-lt-bracket-4.rs | 21 ++++++++ src/test/parse-fail/pat-lt-bracket-5.rs | 13 +++++ src/test/parse-fail/pat-lt-bracket-6.rs | 13 +++++ src/test/parse-fail/pat-lt-bracket-7.rs | 13 +++++ src/test/parse-fail/pat-ranges-1.rs | 15 ++++++ src/test/parse-fail/pat-ranges-2.rs | 15 ++++++ src/test/parse-fail/pat-ranges-3.rs | 15 ++++++ src/test/parse-fail/pat-ranges-4.rs | 15 ++++++ src/test/run-pass/issue-22546.rs | 54 +++++++++++++++++++ src/test/run-pass/pat-ranges.rs | 23 ++++++++ 13 files changed, 197 insertions(+) rename src/test/{compile-fail/issue-22426-1.rs => parse-fail/pat-lt-bracket-1.rs} (100%) rename src/test/{compile-fail/issue-22426-2.rs => parse-fail/pat-lt-bracket-2.rs} (100%) rename src/test/{compile-fail/issue-22426-3.rs => parse-fail/pat-lt-bracket-3.rs} (100%) create mode 100644 src/test/parse-fail/pat-lt-bracket-4.rs create mode 100644 src/test/parse-fail/pat-lt-bracket-5.rs create mode 100644 src/test/parse-fail/pat-lt-bracket-6.rs create mode 100644 src/test/parse-fail/pat-lt-bracket-7.rs create mode 100644 src/test/parse-fail/pat-ranges-1.rs create mode 100644 src/test/parse-fail/pat-ranges-2.rs create mode 100644 src/test/parse-fail/pat-ranges-3.rs create mode 100644 src/test/parse-fail/pat-ranges-4.rs create mode 100644 src/test/run-pass/issue-22546.rs create mode 100644 src/test/run-pass/pat-ranges.rs diff --git a/src/test/compile-fail/issue-22426-1.rs b/src/test/parse-fail/pat-lt-bracket-1.rs similarity index 100% rename from src/test/compile-fail/issue-22426-1.rs rename to src/test/parse-fail/pat-lt-bracket-1.rs diff --git a/src/test/compile-fail/issue-22426-2.rs b/src/test/parse-fail/pat-lt-bracket-2.rs similarity index 100% rename from src/test/compile-fail/issue-22426-2.rs rename to src/test/parse-fail/pat-lt-bracket-2.rs diff --git a/src/test/compile-fail/issue-22426-3.rs b/src/test/parse-fail/pat-lt-bracket-3.rs similarity index 100% rename from src/test/compile-fail/issue-22426-3.rs rename to src/test/parse-fail/pat-lt-bracket-3.rs diff --git a/src/test/parse-fail/pat-lt-bracket-4.rs b/src/test/parse-fail/pat-lt-bracket-4.rs new file mode 100644 index 0000000000000..3d9b492307a7c --- /dev/null +++ b/src/test/parse-fail/pat-lt-bracket-4.rs @@ -0,0 +1,21 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +enum BtNode { + Node(u32,Box,Box), + Leaf(u32), +} + +fn main() { + let y = match x { + Foo::A(value) => value, //~ error: expected one of `=>`, `@`, `if`, or `|`, found `<` + Foo::B => 7, + }; +} diff --git a/src/test/parse-fail/pat-lt-bracket-5.rs b/src/test/parse-fail/pat-lt-bracket-5.rs new file mode 100644 index 0000000000000..3345845eee9ae --- /dev/null +++ b/src/test/parse-fail/pat-lt-bracket-5.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let v[0] = v[1]; //~ error: expected one of `:`, `;`, `=`, or `@`, found `[` +} diff --git a/src/test/parse-fail/pat-lt-bracket-6.rs b/src/test/parse-fail/pat-lt-bracket-6.rs new file mode 100644 index 0000000000000..72fdae82260ea --- /dev/null +++ b/src/test/parse-fail/pat-lt-bracket-6.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let Test(&desc[..]) = x; //~ error: expected one of `,` or `@`, found `[` +} diff --git a/src/test/parse-fail/pat-lt-bracket-7.rs b/src/test/parse-fail/pat-lt-bracket-7.rs new file mode 100644 index 0000000000000..c7731d156ad62 --- /dev/null +++ b/src/test/parse-fail/pat-lt-bracket-7.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + for thing(x[]) {} //~ error: expected one of `,` or `@`, found `[` +} diff --git a/src/test/parse-fail/pat-ranges-1.rs b/src/test/parse-fail/pat-ranges-1.rs new file mode 100644 index 0000000000000..e1cbb961b1bcc --- /dev/null +++ b/src/test/parse-fail/pat-ranges-1.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing of range patterns + +fn main() { + let macropus!() ... 11 = 12; //~ error: expected one of `:`, `;`, or `=`, found `...` +} diff --git a/src/test/parse-fail/pat-ranges-2.rs b/src/test/parse-fail/pat-ranges-2.rs new file mode 100644 index 0000000000000..04ad5ff083bc8 --- /dev/null +++ b/src/test/parse-fail/pat-ranges-2.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing of range patterns + +fn main() { + let 10 ... makropulos!() = 12; //~ error: expected one of `::`, `:`, `;`, or `=`, found `!` +} diff --git a/src/test/parse-fail/pat-ranges-3.rs b/src/test/parse-fail/pat-ranges-3.rs new file mode 100644 index 0000000000000..5f7aac71d29b2 --- /dev/null +++ b/src/test/parse-fail/pat-ranges-3.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing of range patterns + +fn main() { + let 10 ... 10 + 3 = 12; //~ expected one of `:`, `;`, or `=`, found `+` +} diff --git a/src/test/parse-fail/pat-ranges-4.rs b/src/test/parse-fail/pat-ranges-4.rs new file mode 100644 index 0000000000000..50dcb8995279c --- /dev/null +++ b/src/test/parse-fail/pat-ranges-4.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing of range patterns + +fn main() { + let 10 - 3 ... 10 = 8; //~ error: expected one of `...`, `:`, `;`, or `=`, found `-` +} diff --git a/src/test/run-pass/issue-22546.rs b/src/test/run-pass/issue-22546.rs new file mode 100644 index 0000000000000..b3cb8a78213b8 --- /dev/null +++ b/src/test/run-pass/issue-22546.rs @@ -0,0 +1,54 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing patterns with paths with type parameters (issue #22544) + +use std::default::Default; + +#[derive(Default)] +pub struct Foo(T, T); + +impl Foo { + fn foo(&self) { + match *self { + Foo::(ref x, ref y) => println!("Goodbye, World! {} {}", x, y) + } + } +} + +trait Tr { + type U; +} + +impl Tr for Foo { + type U = T; +} + +struct Wrapper { + value: T +} + +fn main() { + let Foo::(a, b) = Default::default(); + + let f = Foo(2,3); + f.foo(); + + let w = Wrapper { value: Foo(10u8, 11u8) }; + match w { + Wrapper::> { value: Foo(10, 11) } => {}, + ::Wrapper::< as Tr>::U> { value: Foo::(11, 16) } => { panic!() }, + _ => { panic!() } + } + + if let None:: = Some(8) { + panic!(); + } +} diff --git a/src/test/run-pass/pat-ranges.rs b/src/test/run-pass/pat-ranges.rs new file mode 100644 index 0000000000000..964989508ccf2 --- /dev/null +++ b/src/test/run-pass/pat-ranges.rs @@ -0,0 +1,23 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Parsing of range patterns + +const NUM1: i32 = 10; + +mod m { + pub const NUM2: i32 = 16; +} + +fn main() { + if let NUM1 ... m::NUM2 = 10 {} else { panic!() } + if let ::NUM1 ... ::m::NUM2 = 11 {} else { panic!() } + if let -13 ... -10 = 12 { panic!() } else {} +} From ad3daa89f2b77aeba508188dd96bf0ffbe633806 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Thu, 2 Apr 2015 19:13:26 -0700 Subject: [PATCH 05/17] Update AUTHORS.txt as of 1.0.0-beta --- AUTHORS.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 4 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 4109797a55ee7..7a800b70e4a38 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -9,17 +9,19 @@ Aaron Todd Aaron Turon Aaron Weiss Adam Bozanich +Adam Jacob Adam Roben Adam Szkoda +Adenilson Cavalcanti Adolfo Ochagavía Adrien Brault Adrien Tétar -Ahmed Charles Ahmed Charles Aidan Cully Aidan Hobson Sayers Akos Kiss Alan Andrade +Alan Cutter Alan Williams Aleksander Balicki Aleksandr Koshlo @@ -29,6 +31,8 @@ Alex Lyon Alex Rønne Petersen Alex Whitney Alexander Bliskovsky +Alexander Campbell +Alexander Chernyakhovsky Alexander Korolkov Alexander Light Alexander Stavonin @@ -41,6 +45,7 @@ Alfie John Ali Smesseim Alisdair Owens Aljaž "g5pw" Srebrnič +Amol Mundayoor Amy Unger Anders Kaseorg Andre Arko @@ -56,6 +61,7 @@ Andrew Cann Andrew Chin Andrew Dunham Andrew Gallant +Andrew Hobden Andrew Paseltiner Andrew Poelstra Andrew Wagner @@ -110,6 +116,8 @@ Brendan McLoughlin Brendan Zabarauskas Brett Cannon Brian Anderson +Brian Brooks +Brian Campbell Brian Dawn Brian J Brennan Brian J. Burg @@ -122,6 +130,8 @@ Cadence Marseille Caitlin Potter Cam Jackson Cameron Zwarich +Camille Roussel +Camille TJHOA CarVac Carl Lerche Carl-Anton Ingmarsson @@ -132,6 +142,8 @@ Carter Hinsley Carter Tazio Schonwald Caspar Krieger Chase Southwood +Ches Martin +Chloe <5paceToast@users.noreply.github.com> Chris Double Chris Morgan Chris Nixon @@ -158,7 +170,9 @@ Corey Farwell Corey Ford Corey Richardson Cristi Burcă +Cristian Kubis DJUrsus +Dabo Ross Damian Gryski Damien Grassart Damien Radtke @@ -167,6 +181,8 @@ Dan Albert Dan Burkert Dan Connolly Dan Luu +Dan Schatzberg +Dan W. <1danwade@gmail.com> Dan Yang Daniel Brooks Daniel Fagnan @@ -174,6 +190,7 @@ Daniel Farina Daniel Griffen Daniel Grunwald Daniel Hofstetter +Daniel Lobato García Daniel Luz Daniel MacDougall Daniel Micay @@ -183,17 +200,23 @@ Daniel Ralston Daniel Rosenwasser Daniel Ursache Dogariu Daniil Smirnov +Darin Morrison +Darrell Hamilton Dave Herman Dave Hodder +Dave Huseby David Creswick David Forsythe David Halperin +David King David Klein +David Mally David Manescu David Rajchenbach-Teller David Renshaw David Vazgenovich Shakaryan Davis Silverman +Denis Defreyne Derecho Derek Chiang Derek Guenther @@ -214,10 +237,12 @@ Do Nhat Minh Dominik Inführ Donovan Preston Douglas Young +Drew Crawford Drew Willcoxon Duane Edwards Duncan Regan Dylan Braithwaite +Dylan Ede Dzmitry Malyshau Earl St Sauver Eduard Bopp @@ -230,12 +255,14 @@ Elantsev Serj Elliott Slaughter Elly Fong-Jones Emanuel Rylke +Emeliov Dmitrii Eric Allen Eric Biggers Eric Holk Eric Holmes Eric Kidd Eric Martin +Eric Platon Eric Reed Erick Rivas Erick Tryzelaar @@ -268,6 +295,7 @@ Florian Wilkens Florian Zeitz Francisco Souza Franklin Chen +FuGangqiang Gabriel Gareth Daniel Smith Garrett Heel @@ -279,8 +307,10 @@ Geoffrey Thomas Geoffroy Couprie George Papanikolaou Georges Dubus +Germano Gabbianelli Gil Cottle Gioele Barabucci +GlacJAY Gleb Kozyrev Glenn Willen Gonçalo Cabrita <_@gmcabrita.com> @@ -303,9 +333,11 @@ Herman J. Radtke III HeroesGrave Hong Chulju Honza Strnad +Huachao Huang Hugo Jobling Hugo van der Wijst Huon Wilson +Hyeon Kim Ian Connolly Ian D. Bollinger Ian Daniher @@ -318,12 +350,14 @@ Isaac Aggrey Isaac Dupree Ivan Enderlin Ivan Petkov +Ivan Radanov Ivanov Ivan Ukhov Ivano Coppola J. J. Weber J.C. Moyer JONNALAGADDA Srinivas JP Sugarbroad +JP-Ellis Jack Heizer Jack Moffitt Jacob Edelman @@ -338,6 +372,7 @@ Jake Kerr Jake Scott Jakub Bukaj Jakub Wieczorek +Jakub Vrána James Deng James Hurst James Lal @@ -359,6 +394,7 @@ Jason Toffaletti Jauhien Piatlicki Jay Anderson Jay True +Jeaye Jed Davis Jed Estep Jeff Balogh @@ -375,29 +411,36 @@ Jesse Jones Jesse Luehrs Jesse Ray Jesse Ruderman -Jihyun Yu +Jessy Diamond Exum +Jihyeok Seo +Jihyun Yu Jim Apple Jim Blandy Jim Radford Jimmie Elvenmark Jimmy Lu Jimmy Zelinskie +Jiří Stránský Joe Pletcher Joe Schafer Johannes Hoff Johannes Löthberg Johannes Muenzel +Johannes Oertel John Albietz John Barker John Clements +John Ericson John Fresco John Gallagher John Hodge John Kåre Alsaker John Kleint +John Kåre Alsaker John Louis Walker John Schmidt John Simon +John Zhang Jon Haddad Jon Morton Jonas Hietala @@ -407,6 +450,7 @@ Jonathan Reem Jonathan S Jonathan Sternberg Joonas Javanainen +Jordan Woehr Jordi Boggiano Jorge Aparicio Jorge Israel Peña @@ -423,16 +467,17 @@ Joshua Wise Joshua Yanovski Julia Evans Julian Orth +Julian Viereck Junseok Lee Junyoung Cho JustAPerson Justin Noah Jyun-Yan You Kang Seonghoon -Kang Seonghoon Kasey Carrothers Keegan McAllister Kelly Wilson +Kelvin Ly Ken Tossell KernelJ Keshav Kini @@ -442,6 +487,7 @@ Kevin Butler Kevin Cantu Kevin Mehall Kevin Murphy +Kevin Rauwolf Kevin Walter Kevin Yap Kiet Tran @@ -459,6 +505,8 @@ Lee Wondong LemmingAvalanche Lennart Kudling Leo Testard +Leonids Maslovs +Liam Monahan Liigo Zhuang Lindsey Kuper Lionel Flandrin @@ -495,6 +543,7 @@ Mathijs van de Nes Matt Brubeck Matt Carberry Matt Coffin +Matt Cox Matt McPherrin Matt Murphy Matt Roche @@ -532,6 +581,7 @@ Michael Sullivan Michael Williams Michael Woerister Michael Zhou +Michał Krasnoborski Mick Koch Mickaël Delahaye Mihnea Dobrescu-Balaur @@ -559,7 +609,9 @@ Nathaniel Theis Neil Pankey Nelson Chen NiccosSystem +Nicholas Nicholas Bishop +Nicholas Mazzuca Nick Cameron Nick Desaulniers Nick Howell @@ -579,8 +631,10 @@ Oliver Schneider Olivier Saut Olle Jonsson Or Brostovski +Or Neeman Oren Hazi Orpheus Lummis +Orphée Lafond-Lummis P1start Pablo Brasero Palmer Cox @@ -590,8 +644,11 @@ Patrick Reisert Patrick Walton Patrick Yevsukov Patrik Kårlin +Paul ADENOT Paul Collier +Paul Collins Paul Crowley +Paul Osborne Paul Stansifer Paul Woolcock Pavel Panchekha @@ -602,6 +659,7 @@ Peter Atashian Peter Elmers Peter Hull Peter Marheine +Peter Minten Peter Schuller Peter Williams Peter Zotov @@ -620,14 +678,17 @@ Potpourri Pradeep Kumar Prudhvi Krishna Surapaneni Pyfisch +Pyry Kontio Pythoner6 Q.P.Liu Rafael Ávila de Espíndola +Rahul Horé Ralph Bodenner Ralph Giles Ramkumar Ramachandra Randati Raphael Catolino +Raphael Nestler Raphael Speyer Raul Gutierrez S Ray Clanan @@ -637,6 +698,7 @@ Renato Riccieri Santos Zannon Renato Zannon Reuben Morais Ricardo M. Correia +Ricardo Martins Rich Lane Richard Diamond Richo Healey @@ -663,10 +725,13 @@ Russell Ruud van Asseldonk Ryan Levick Ryan Mulligan +Ryan Prichard +Ryan Riginding Ryan Scheel Ryman Rüdiger Sonderfeld S Pradeep Kumar +Sae-bom Kim Salem Talha Samuel Chase Samuel Neves @@ -678,6 +743,7 @@ Santiago Rodriguez Saurabh Anand Scott Jenkins Scott Lawrence +Scott Olson Sean Chalmers Sean Collins Sean Gillespie @@ -730,10 +796,13 @@ Tamir Duberstein Taras Shpot Taylor Hutchison Ted Horst +Tero Hänninen Thad Guidry Thiago Carvalho +Thiago Pontes Thomas Backman Thomas Daede +Tiago Nobrega Till Hoeppner Tim Brooks Tim Chevalier @@ -760,6 +829,7 @@ Toni Cárdenas Tony Young Torsten Weber Travis Watkins +Trent Nadeau Trent Ogren Trinick Tristan Storch @@ -769,9 +839,9 @@ TyOverby Tycho Sci Tyler Bindon Tyler Thrailkill -U-NOV2010\eugals Ulrik Sverdrup Ulysse Carion +User Jyyou Utkarsh Kukreti Uwe Dauernheim Vadim Chugunov @@ -797,6 +867,7 @@ Wade Mealing Wangshan Lu WebeWizard Wendell Smith +Wesley Wiser Will William Ting Willson Mock @@ -817,12 +888,16 @@ Zack Slayton Zbigniew Siciarz Ziad Hatahet Zooko Wilcox-O'Hearn +adridu59 aochagavia areski arturo auREAX +awlnx +aydin.kim b1nd bachm +bcoopers blackbeam blake2-ppc bluss @@ -835,6 +910,7 @@ comex crhino dan@daramos.com darkf +defuz dgoon donkopotamus eliovir @@ -845,6 +921,7 @@ fort free-Runner g3xzh gamazeps +gareth gentlefolk gifnksm hansjorg @@ -860,6 +937,8 @@ joaoxsouls jrincayc juxiliary jxv +kgv +kjpgit klutzy korenchkin kud1ing @@ -868,6 +947,7 @@ kvark kwantam lpy lucy +lummax lyuts m-r-r madmalik @@ -882,20 +962,26 @@ mrec musitdev nathan dotz nham +niftynif noam novalis +nsf +nwin oli-obk olivren osa1 posixphreak qwitwa +ray glover reedlepee +reus rjz sevrak sheroze1123 smenardpw sp3d startling +tav th0114nd theptrk thiagopnts @@ -911,3 +997,5 @@ xales zofrex zslayton zzmp +Łukasz Niemier +克雷 From 6529872afcd4934cd16202a67c747df6674f76c6 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Thu, 2 Apr 2015 22:22:44 -0700 Subject: [PATCH 06/17] Adjust `AsRef` impl for `Cow` The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed. --- src/libcollections/borrow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcollections/borrow.rs b/src/libcollections/borrow.rs index 2fe769b73f5cc..4503ad14e92b4 100644 --- a/src/libcollections/borrow.rs +++ b/src/libcollections/borrow.rs @@ -342,7 +342,7 @@ impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: Clone> AsRef for Cow<'a, T> { +impl<'a, T: ?Sized + ToOwned> AsRef for Cow<'a, T> { fn as_ref(&self) -> &T { self } From b406782e29cef9615dcc14b70404b872de25d771 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Thu, 2 Apr 2015 22:47:50 -0700 Subject: [PATCH 07/17] Indicate associated type in comment is code-like --- src/libcore/iter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 42e90ec34db7c..b5f16b6ccf260 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -1065,7 +1065,7 @@ pub trait IntoIterator { #[stable(feature = "rust1", since = "1.0.0")] type Item; - /// A container for iterating over elements of type Item + /// A container for iterating over elements of type `Item` #[stable(feature = "rust1", since = "1.0.0")] type IntoIter: Iterator; From 0621a83ba56943eb080fc523ae713cd4bdb9b882 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Fri, 3 Apr 2015 15:05:54 +0200 Subject: [PATCH 08/17] Workaround `javac` popup on MacOS X MacOS X does not ship with Java installed by default. Instead it includes binary stubs that upon execution pop up a message suggesting the installation of the JDK. Since `javac` is only used when `antlr4` is available, it is possible to work around the popup by only probing for `javac` if `antlr4` has been successfully detected (in which case the JDK is probably already installed on the system). Fixes #23138. --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index ca73c1cf8b1c3..5de6f3c7e1f82 100755 --- a/configure +++ b/configure @@ -669,7 +669,6 @@ probe CFG_LD ld probe CFG_VALGRIND valgrind probe CFG_PERF perf probe CFG_ISCC iscc -probe CFG_JAVAC javac probe CFG_ANTLR4 antlr4 probe CFG_GRUN grun probe CFG_FLEX flex @@ -679,6 +678,14 @@ probe CFG_XELATEX xelatex probe CFG_GDB gdb probe CFG_LLDB lldb +# On MacOS X, invoking `javac` pops up a dialog if the JDK is not +# installed. Since `javac` is only used if `antlr4` is available, +# probe for it only in this case. +if [ ! -z "$CFG_ANTLR4" ] +then + probe CFG_JAVAC javac +fi + if [ ! -z "$CFG_GDB" ] then # Store GDB's version From 787c6cda00f45de8634052b743b384f1fdaee7e0 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Thu, 2 Apr 2015 17:27:19 -0700 Subject: [PATCH 09/17] this correctly disables jemalloc on Bitrig --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index ca73c1cf8b1c3..1c0911314b2fb 100755 --- a/configure +++ b/configure @@ -545,7 +545,6 @@ opt verify-install 1 "verify installed binaries work" # This is used by the automation to produce single-target nightlies opt dist-host-only 0 "only install bins for the host architecture" opt inject-std-version 1 "inject the current compiler version of libstd into programs" -opt jemalloc 1 "build liballoc with jemalloc" opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway" valopt localstatedir "/var/lib" "local state directory" @@ -562,6 +561,7 @@ valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path" # (others are conditionally saved). opt_nosave manage-submodules 1 "let the build manage the git submodules" opt_nosave clang 0 "prefer clang to gcc for building the runtime" +opt_nosave jemalloc 1 "build liballoc with jemalloc" valopt_nosave prefix "/usr/local" "set installation prefix" valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary" @@ -775,7 +775,7 @@ if [ $CFG_OSTYPE = unknown-bitrig ] then step_msg "on Bitrig, forcing use of clang, disabling jemalloc" CFG_ENABLE_CLANG=1 - CFG_ENABLE_JEMALLOC=0 + CFG_DISABLE_JEMALLOC=1 fi if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ] @@ -828,6 +828,12 @@ then putvar CFG_ENABLE_CLANG fi +# Same with jemalloc. save the setting here. +if [ ! -z "$CFG_DISABLE_JEMALLOC" ] +then + putvar CFG_DISABLE_JEMALLOC +fi + if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ] then step_msg "using custom LLVM at $CFG_LLVM_ROOT" From 2f63e9c127ceff853f560a8a74f6d37c8ebad400 Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Fri, 3 Apr 2015 13:23:58 -0400 Subject: [PATCH 10/17] Remove unnecessary `Vec<_>` annotation from docs This was brought up in IRC by a confused reader. --- src/libcollections/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 087b065031f2b..b767a1ea054c1 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -185,7 +185,7 @@ impl Vec { /// # Examples /// /// ``` - /// let mut vec: Vec<_> = Vec::with_capacity(10); + /// let mut vec = Vec::with_capacity(10); /// /// // The vector contains no items, even though it has capacity for more /// assert_eq!(vec.len(), 0); From 862e16025af182a603f350cddb5de9e2f4f1cfb6 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 3 Apr 2015 15:24:47 -0400 Subject: [PATCH 11/17] Don't speak of old_io from https://news.ycombinator.com/item?id=9317822 --- src/libstd/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5c9ff544fa3e8..df81981c3f445 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -77,9 +77,8 @@ //! including [`atomic`](sync/atomic/index.html), and [`mpsc`](sync/mpsc/index.html), //! which contains the channel types for message passing. //! -//! Common types of I/O, including files, TCP, UDP, pipes, Unix domain sockets, -//! timers, and process spawning, are defined in the -//! [`old_io`](old_io/index.html) module. +//! Common types of I/O, including files, TCP, UDP, pipes, Unix domain sockets, and +//! process spawning, are defined in the [`io`](io/index.html) module. //! //! Rust's I/O and concurrency depends on a small runtime interface //! that lives, along with its support code, in mod [`rt`](rt/index.html). From 3b73a6e3cee96e6065fa9cc65dc89475f87d1653 Mon Sep 17 00:00:00 2001 From: Dan Callahan Date: Fri, 3 Apr 2015 14:29:33 -0500 Subject: [PATCH 12/17] Remove old_io from trpl/concurrency.md Also: the std_misc feature flag is removed; it's not needed in Beta. Hat tip to @tshepang in #23871 Fixes #24023 --- src/doc/trpl/concurrency.md | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/src/doc/trpl/concurrency.md b/src/doc/trpl/concurrency.md index 6b814a685424e..bc0a76bc2b6e7 100644 --- a/src/doc/trpl/concurrency.md +++ b/src/doc/trpl/concurrency.md @@ -88,17 +88,14 @@ When `guard` goes out of scope, it will block execution until the thread is finished. If we didn't want this behaviour, we could use `thread::spawn()`: ``` -# #![feature(old_io, std_misc)] use std::thread; -use std::old_io::timer; -use std::time::Duration; fn main() { thread::spawn(|| { println!("Hello from a thread!"); }); - timer::sleep(Duration::milliseconds(50)); + thread::sleep_ms(50); } ``` @@ -147,10 +144,7 @@ As an example, here is a Rust program that would have a data race in many languages. It will not compile: ```ignore -# #![feature(old_io, std_misc)] use std::thread; -use std::old_io::timer; -use std::time::Duration; fn main() { let mut data = vec![1u32, 2, 3]; @@ -161,14 +155,14 @@ fn main() { }); } - timer::sleep(Duration::milliseconds(50)); + thread::sleep_ms(50); } ``` This gives us an error: ```text -12:17 error: capture of moved value: `data` +8:17 error: capture of moved value: `data` data[i] += 1; ^~~~ ``` @@ -187,10 +181,7 @@ only one person at a time can mutate what's inside. For that, we can use the but for a different reason: ```ignore -# #![feature(old_io, std_misc)] use std::thread; -use std::old_io::timer; -use std::time::Duration; use std::sync::Mutex; fn main() { @@ -203,17 +194,17 @@ fn main() { }); } - timer::sleep(Duration::milliseconds(50)); + thread::sleep_ms(50); } ``` Here's the error: ```text -:11:9: 11:22 error: the trait `core::marker::Send` is not implemented for the type `std::sync::mutex::MutexGuard<'_, collections::vec::Vec>` [E0277] +:9:9: 9:22 error: the trait `core::marker::Send` is not implemented for the type `std::sync::mutex::MutexGuard<'_, collections::vec::Vec>` [E0277] :11 thread::spawn(move || { ^~~~~~~~~~~~~ -:11:9: 11:22 note: `std::sync::mutex::MutexGuard<'_, collections::vec::Vec>` cannot be sent between threads safely +:9:9: 9:22 note: `std::sync::mutex::MutexGuard<'_, collections::vec::Vec>` cannot be sent between threads safely :11 thread::spawn(move || { ^~~~~~~~~~~~~ ``` @@ -232,11 +223,8 @@ guard across thread boundaries, which gives us our error. We can use `Arc` to fix this. Here's the working version: ``` -# #![feature(old_io, std_misc)] use std::sync::{Arc, Mutex}; use std::thread; -use std::old_io::timer; -use std::time::Duration; fn main() { let data = Arc::new(Mutex::new(vec![1u32, 2, 3])); @@ -249,7 +237,7 @@ fn main() { }); } - timer::sleep(Duration::milliseconds(50)); + thread::sleep_ms(50); } ``` @@ -258,11 +246,9 @@ handle is then moved into the new thread. Let's examine the body of the thread more closely: ``` -# #![feature(old_io, std_misc)] # use std::sync::{Arc, Mutex}; # use std::thread; -# use std::old_io::timer; -# use std::time::Duration; +# # fn main() { # let data = Arc::new(Mutex::new(vec![1u32, 2, 3])); # for i in 0..2 { @@ -272,6 +258,8 @@ thread::spawn(move || { data[i] += 1; }); # } +# +# thread::sleep_ms(50); # } ``` From 925a52cb9324e6fdf5c97d5c0e852e39c6969b4a Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 3 Apr 2015 19:09:41 -0400 Subject: [PATCH 13/17] Update Rust install instructions in TRPL Default is now beta, add nightly in the unstable section --- src/doc/trpl/installing-rust.md | 4 +-- src/doc/trpl/unstable.md | 50 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/installing-rust.md b/src/doc/trpl/installing-rust.md index 288a4a158fb80..c839688047aa6 100644 --- a/src/doc/trpl/installing-rust.md +++ b/src/doc/trpl/installing-rust.md @@ -18,9 +18,9 @@ $ sudo sh rustup.sh ``` If you're on Windows, please download either the [32-bit -installer](https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe) +installer](https://static.rust-lang.org/dist/rust-1.0.0-beta-i686-pc-windows-gnu.exe) or the [64-bit -installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.exe) +installer](https://static.rust-lang.org/dist/rust-1.0.0-beta-x86_64-pc-windows-gnu.exe) and run it. If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay. diff --git a/src/doc/trpl/unstable.md b/src/doc/trpl/unstable.md index e8e02cc9d092c..d69831c237838 100644 --- a/src/doc/trpl/unstable.md +++ b/src/doc/trpl/unstable.md @@ -1 +1,51 @@ % Unstable Rust + +Rust provides three distribution channels for Rust: nightly, beta, and stable. +Unstable features are only available on nightly Rust. For more details on this +process, see [this post](http://blog.rust-lang.org/2014/10/30/Stability.html). + +To install nightly Rust, you can use `rustup.sh`: + +```bash +$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --channel=nightly +``` + +If you're concerned about the [potential insecurity](http://curlpipesh.tumblr.com/) of using `curl | sudo sh`, +please keep reading and see our disclaimer below. And feel free to use a two-step version of the installation and examine our installation script: + +```bash +$ curl -f -L https://static.rust-lang.org/rustup.sh -O +$ sudo sh rustup.sh --channel=nightly +``` + +If you're on Windows, please download either the [32-bit +installer](https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe) +or the [64-bit +installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.exe) +and run it. + +If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay. +Not every programming language is great for everyone. Just run the uninstall +script: + +```bash +$ sudo /usr/local/lib/rustlib/uninstall.sh +``` + +If you used the Windows installer, just re-run the `.exe` and it will give you +an uninstall option. + +You can re-run this script any time you want to update Rust. Which, at this +point, is often. Rust is still pre-1.0, and so people assume that you're using +a very recent Rust. + +This brings me to one other point: some people, and somewhat rightfully so, get +very upset when we tell you to `curl | sudo sh`. And they should be! Basically, +when you do this, you are trusting that the good people who maintain Rust +aren't going to hack your computer and do bad things. That's a good instinct! +If you're one of those people, please check out the documentation on [building +Rust from Source](https://github.com/rust-lang/rust#building-from-source), or +[the official binary downloads](http://www.rust-lang.org/install.html). And we +promise that this method will not be the way to install Rust forever: it's just +the easiest way to keep people updated while Rust is in its alpha state. + From 692c88c9bc5e0f8d8fc1b732874a48dcf2c47b0a Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 3 Apr 2015 18:09:11 -0700 Subject: [PATCH 14/17] Simplify `match` branches in documentation comment --- src/libcore/result.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index eff04dd590393..42d0b2a2c62ff 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -46,12 +46,8 @@ //! //! let version = parse_version(&[1, 2, 3, 4]); //! match version { -//! Ok(v) => { -//! println!("working with version: {:?}", v); -//! } -//! Err(e) => { -//! println!("error parsing header: {:?}", e); -//! } +//! Ok(v) => println!("working with version: {:?}", v), +//! Err(e) => println!("error parsing header: {:?}", e), //! } //! ``` //! From 6ff085c9a9ae5ac5da186ca85e1bd642d6154bec Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 3 Apr 2015 18:32:29 -0700 Subject: [PATCH 15/17] Make example function in comment more idiomatic --- src/libcore/result.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index eff04dd590393..5be46a09a95d2 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -34,13 +34,11 @@ //! enum Version { Version1, Version2 } //! //! fn parse_version(header: &[u8]) -> Result { -//! if header.len() < 1 { -//! return Err("invalid header length"); -//! } -//! match header[0] { -//! 1 => Ok(Version::Version1), -//! 2 => Ok(Version::Version2), -//! _ => Err("invalid version") +//! match header.get(0) { +//! None => Err("invalid header length"), +//! Some(&1) => Ok(Version::Version1), +//! Some(&2) => Ok(Version::Version2), +//! Some(_) => Err("invalid version") //! } //! } //! From eb2a6d9866c4bb662d7ca5d735a6b25801c2f2f9 Mon Sep 17 00:00:00 2001 From: Augusto Hack Date: Fri, 3 Apr 2015 22:56:34 -0300 Subject: [PATCH 16/17] Removed repeated sentence. --- src/doc/trpl/closures.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/doc/trpl/closures.md b/src/doc/trpl/closures.md index 01b8163ffd372..52d07ae465f44 100644 --- a/src/doc/trpl/closures.md +++ b/src/doc/trpl/closures.md @@ -175,9 +175,6 @@ we called `add_num`, it mutated the underlying value, as we'd expect. We also needed to declare `add_num` as `mut` too, because we’re mutating its environment. -We also had to declare `add_num` as mut, since we will be modifying its -environment. - If we change to a `move` closure, it's different: ```rust From b62c11023c4fdbb1e6ef9f074310a8e95db7827e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sat, 4 Apr 2015 12:50:43 +0530 Subject: [PATCH 17/17] Fix doc (fixup #24031) --- src/doc/trpl/concurrency.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/doc/trpl/concurrency.md b/src/doc/trpl/concurrency.md index bc0a76bc2b6e7..f9358f28b0194 100644 --- a/src/doc/trpl/concurrency.md +++ b/src/doc/trpl/concurrency.md @@ -245,10 +245,9 @@ We now call `clone()` on our `Arc`, which increases the internal count. This handle is then moved into the new thread. Let's examine the body of the thread more closely: -``` +```rust # use std::sync::{Arc, Mutex}; # use std::thread; -# # fn main() { # let data = Arc::new(Mutex::new(vec![1u32, 2, 3])); # for i in 0..2 { @@ -258,7 +257,6 @@ thread::spawn(move || { data[i] += 1; }); # } -# # thread::sleep_ms(50); # } ```