]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #13291 : thestinger/rust/no_null, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 4 Apr 2014 11:41:49 +0000 (04:41 -0700)
committerbors <bors@rust-lang.org>
Fri, 4 Apr 2014 11:41:49 +0000 (04:41 -0700)
This was missed when dropping the null-termination from our string
types. An explicit null byte can still be placed anywhere in a string if
desired, but there's no reason to stick one at the end of every string
constant.

181 files changed:
AUTHORS.txt
README.md
man/rustc.1
man/rustdoc.1
mk/docs.mk
mk/main.mk
mk/tests.mk
src/compiletest/procsrv.rs
src/compiletest/runtest.rs
src/doc/README.md
src/doc/po/ja/complement-cheatsheet.md.po
src/doc/po/ja/complement-lang-faq.md.po
src/doc/po/ja/complement-project-faq.md.po
src/doc/po/ja/complement-usage-faq.md.po
src/doc/po/ja/guide-conditions.md.po
src/doc/po/ja/guide-container.md.po
src/doc/po/ja/guide-ffi.md.po
src/doc/po/ja/guide-lifetimes.md.po
src/doc/po/ja/guide-macros.md.po
src/doc/po/ja/guide-pointers.md.po
src/doc/po/ja/guide-runtime.md.po
src/doc/po/ja/guide-tasks.md.po
src/doc/po/ja/guide-testing.md.po
src/doc/po/ja/index.md.po
src/doc/po/ja/rustdoc.md.po
src/doc/po/ja/tutorial.md.po
src/doc/rust.md
src/doc/tutorial.md
src/etc/emacs/rust-mode.el
src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang
src/etc/kate/rust.xml
src/libarena/lib.rs
src/libcollections/lib.rs
src/libflate/lib.rs
src/libfourcc/lib.rs
src/libgetopts/lib.rs
src/libglob/lib.rs
src/libgreen/lib.rs
src/libhexfloat/lib.rs
src/liblog/lib.rs
src/libnative/lib.rs
src/libnum/lib.rs
src/librand/distributions/exponential.rs
src/librand/distributions/normal.rs
src/librand/lib.rs
src/librustc/back/abi.rs
src/librustc/back/archive.rs
src/librustc/back/link.rs
src/librustc/front/config.rs
src/librustc/front/std_inject.rs
src/librustc/lib.rs
src/librustc/lib/llvm.rs
src/librustc/metadata/common.rs
src/librustc/metadata/creader.rs
src/librustc/metadata/csearch.rs
src/librustc/metadata/cstore.rs
src/librustc/metadata/decoder.rs
src/librustc/metadata/encoder.rs
src/librustc/metadata/filesearch.rs
src/librustc/metadata/loader.rs
src/librustc/metadata/tydecode.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/mod.rs
src/librustc/middle/cfg/mod.rs
src/librustc/middle/const_eval.rs
src/librustc/middle/dataflow.rs
src/librustc/middle/freevars.rs
src/librustc/middle/graph.rs
src/librustc/middle/kind.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/lint.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/pat_util.rs
src/librustc/middle/privacy.rs
src/librustc/middle/region.rs
src/librustc/middle/trans/adt.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/basic_block.rs
src/librustc/middle/trans/build.rs
src/librustc/middle/trans/builder.rs
src/librustc/middle/trans/cabi.rs
src/librustc/middle/trans/callee.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/trans/context.rs
src/librustc/middle/trans/datum.rs
src/librustc/middle/trans/expr.rs
src/librustc/middle/trans/foreign.rs
src/librustc/middle/trans/meth.rs
src/librustc/middle/trans/monomorphize.rs
src/librustc/middle/trans/reflect.rs
src/librustc/middle/trans/tvec.rs
src/librustc/middle/trans/type_.rs
src/librustc/middle/trans/type_of.rs
src/librustc/middle/trans/value.rs
src/librustc/middle/ty.rs
src/librustc/middle/ty_fold.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/check/method.rs
src/librustc/middle/typeck/check/mod.rs
src/librustc/middle/typeck/collect.rs
src/librustc/middle/typeck/infer/coercion.rs
src/librustc/middle/typeck/infer/combine.rs
src/librustc/middle/typeck/infer/glb.rs
src/librustc/middle/typeck/infer/lub.rs
src/librustc/middle/typeck/infer/mod.rs
src/librustc/middle/typeck/infer/resolve.rs
src/librustc/middle/typeck/infer/sub.rs
src/librustc/middle/typeck/mod.rs
src/librustc/middle/typeck/rscope.rs
src/librustc/util/common.rs
src/librustc/util/ppaux.rs
src/librustdoc/clean.rs
src/librustdoc/html/escape.rs
src/librustdoc/html/format.rs
src/librustdoc/html/markdown.rs
src/librustdoc/lib.rs
src/librustdoc/test.rs
src/librustdoc/visit_ast.rs
src/librustuv/lib.rs
src/libsemver/lib.rs
src/libserialize/base64.rs
src/libserialize/lib.rs
src/libstd/lib.rs
src/libstd/macros.rs
src/libstd/rt/global_heap.rs
src/libstd/rt/task.rs
src/libstd/sync/atomics.rs
src/libstd/unstable/simd.rs
src/libstd/vec.rs
src/libsync/lib.rs
src/libsyntax/abi.rs
src/libsyntax/ast.rs
src/libsyntax/ast_map.rs
src/libsyntax/codemap.rs
src/libsyntax/ext/build.rs
src/libsyntax/fold.rs
src/libsyntax/lib.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs
src/libterm/lib.rs
src/libtest/lib.rs
src/libtime/lib.rs
src/liburl/lib.rs
src/libuuid/lib.rs
src/libworkcache/lib.rs
src/rustllvm/RustWrapper.cpp
src/rustllvm/rustllvm.def.in [deleted file]
src/test/auxiliary/issue-11508.rs
src/test/auxiliary/issue-11529.rs
src/test/auxiliary/issue-11908-1.rs
src/test/auxiliary/issue-11908-2.rs
src/test/auxiliary/issue-7899.rs
src/test/auxiliary/issue_10031_aux.rs
src/test/auxiliary/issue_2472_b.rs
src/test/auxiliary/lint_stability.rs
src/test/auxiliary/newtype_struct_xc.rs
src/test/auxiliary/privacy-tuple-struct.rs [new file with mode: 0644]
src/test/bench/rt-spawn-rate.rs
src/test/compile-fail/privacy5.rs [new file with mode: 0644]
src/test/debug-info/basic-types-globals-metadata.rs
src/test/debug-info/basic-types-globals.rs
src/test/debug-info/basic-types-mut-globals.rs
src/test/debug-info/c-style-enum.rs
src/test/debug-info/lexical-scope-in-for-loop.rs
src/test/debug-info/lexical-scope-in-if.rs
src/test/debug-info/lexical-scope-in-match.rs
src/test/debug-info/lexical-scopes-in-block-expression.rs
src/test/debug-info/simple-struct.rs
src/test/debug-info/simple-tuple.rs
src/test/debug-info/var-captured-in-nested-closure.rs
src/test/debug-info/vec-slices.rs
src/test/debug-info/vec.rs
src/test/run-make/crate-data-smoke/Makefile
src/test/run-make/crate-data-smoke/crate.rs
src/test/run-pass/backtrace.rs
src/test/run-pass/empty-allocation-non-null.rs [new file with mode: 0644]
src/test/run-pass/extern-fn-reachable.rs
src/test/run-pass/use.rs

index dd9dedc0d810db337141d894f5f0b738fdc88544..639277f0c0cc391da96a4e7ad7c371073c0109c8 100644 (file)
@@ -9,29 +9,38 @@ Aleksander Balicki <balicki.aleksander@gmail.com>
 Alex Crichton <alex@alexcrichton.com>
 Alex Lyon <arcterus@mail.com>
 Alex Rønne Petersen <alex@lycus.org>
+Alex Whitney <aw1209@ic.ac.uk>
 Alexander Stavonin <a.stavonin@gmail.com>
 Alexandros Tasos <sdi1100085@di.uoa.gr>
 Alexei Sholik <alcosholik@gmail.com>
 Aljaž "g5pw" Srebrnič <a2piratesoft@gmail.com>
 Anders Kaseorg <andersk@mit.edu>
+Andre Arko <andre@arko.net>
 Andreas Gal <gal@mozilla.com>
 Andreas Martens <andreasm@fastmail.fm>
 Andreas Neuhaus <zargony@zargony.com>
 Andreas Ots <andreasots@gmail.com>
 Andrei Formiga <archimedes_siracusa@hotmail.com>
+Andrew Chin <achin@eminence32.net>
 Andrew Dunham <andrew@du.nham.ca>
 Andrew Paseltiner <apaseltiner@gmail.com>
 Anthony Juckel <ajuckel@gmail.com>
+aochagavia <aochagavia92@gmail.com>
+Arcterus <Arcterus@mail.com>
 Arkaitz Jimenez <arkaitzj@gmail.com>
 Armin Ronacher <armin.ronacher@active-4.com>
 Ashok Gautham <ScriptDevil@gmail.com>
 Austin King <shout@ozten.com>
 Austin Seipp <mad.one@gmail.com>
+Axel Viala <axel.viala@darnuria.eu>
 Aydin Kim <ladinjin@hanmail.net>
 auREAX <mark@xn--hwg34fba.ws>
+b1nd <clint.ryan3@gmail.com>
 Ben Alpert <ben@benalpert.com>
 Ben Blum <bblum@andrew.cmu.edu>
+Ben Harris <mail@bharr.is>
 Ben Kelly <ben@wanderview.com>
+Ben Noordhuis <info@bnoordhuis.nl>
 Ben Striegel <ben.striegel@gmail.com>
 Benjamin Herr <ben@0x539.de>
 Benjamin Jackman <ben@jackman.biz>
@@ -55,7 +64,9 @@ Brian Anderson <banderson@mozilla.com>
 Brian Dawn <brian.t.dawn@gmail.com>
 Brian J. Burg <burg@cs.washington.edu>
 Brian Leibig <brian.leibig@gmail.com>
+Bruno de Oliveira Abinader <bruno.d@partner.samsung.com>
 Bryan Dunsmore <dunsmoreb@gmail.com>
+Byron Williams <byron@112percent.com>
 Cadence Marseille <cadencemarseille@gmail.com>
 Caitlin Potter <snowball@defpixel.com>
 Carl-Anton Ingmarsson <mail@carlanton.se>
@@ -68,16 +79,24 @@ Chris Morgan <me@chrismorgan.info>
 Chris Peterson <cpeterson@mozilla.com>
 Chris Pressey <cpressey@gmail.com>
 Chris Sainty <csainty@hotmail.com>
+Chris Wong <lambda.fairy@gmail.com>
+chromatic <chromatic@wgz.org>
+Clark Gaebel <cg.wowus.cg@gmail.com>
 Cody Schroeder <codys@cs.washington.edu>
+Cole Mickens <cole.mickens@gmail.com>
+Colin Sherratt <colin.sherratt@gmail.com>
+comex <comexk@gmail.com>
 Corey Richardson <corey@octayn.net>
 Damian Gryski <damian@gryski.com>
 Damien Grassart <damien@grassart.com>
 Damien Schoof <damien.schoof@gmail.com>
-Daniel Brooks <db48x@db48x.net>
-Daniel Farina <daniel@fdr.io>
 Dan Connolly <dckc@madmode.com>
 Dan Luu <danluu@gmail.com>
+Daniel Brooks <db48x@db48x.net>
+Daniel Fagnan <dnfagnan@gmail.com>
+Daniel Farina <daniel@fdr.io>
 Daniel Luz <dev@mernen.com>
+Daniel MacDougall <dmacdougall@gmail.com>
 Daniel Micay <danielmicay@gmail.com>
 Daniel Patterson <dbp@riseup.net>
 Daniel Ralston <Wubbulous@gmail.com>
@@ -90,19 +109,30 @@ David Creswick <dcrewi@gyrae.net>
 David Forsythe <dforsythe@gmail.com>
 David Halperin <halperin.dr@gmail.com>
 David Klein <david.klein@baesystemsdetica.com>
-David Manescu <dman2626@uni.sydney.edu.au>
+David Manescu <david.manescu@gmail.com>
 David Rajchenbach-Teller <dteller@mozilla.com>
 David Renshaw <dwrenshaw@gmail.com>
+Davis Silverman <sinistersnare@gmail.com>
+Derek Chiang <derekchiang93@gmail.com>
+Derek Guenther <dguenther9@gmail.com>
 Diego Ongaro <ongaro@cs.stanford.edu>
 Diggory Hardy <diggory.hardy@gmail.com>
 Dimitri Krassovski <labria@startika.com>
 Dirkjan Bussink <d.bussink@gmail.com>
+Div Shekhar <div@pagerduty.com>
 Dmitry Ermolov <epdmitry@yandex.ru>
+Dmitry Promsky <dmitry@willworkforcookies.com>
+Dmitry Vasiliev <dima@hlabs.org>
 Do Nhat Minh <mrordinaire@gmail.com>
+Douglas Young <rcxdude@gmail.com>
 Donovan Preston <donovanpreston@gmail.com>
 Drew Willcoxon <adw@mozilla.com>
+Dylan Braithwaite <dylanbraithwaite1@gmail.com>
+Eduard Bopp <eduard.bopp@aepsil0n.de>
 Eduard Burtescu <edy.burt@gmail.com>
+Edward Wang <edward.yu.wang@gmail.com>
 Edward Z. Yang <ezyang@cs.stanford.edu>
+Ehsanul Hoque <ehsanul@ehsanul.com>
 eliovir <eliovir@gmail.com>
 Elliott Slaughter <elliottslaughter@gmail.com>
 Elly Fong-Jones <elly@leptoquark.net>
@@ -116,9 +146,11 @@ Erick Tryzelaar <erick.tryzelaar@gmail.com>
 Erik Price <erik.price16@gmail.com>
 Erik Rose <erik@mozilla.com>
 Etienne Millon <me@emillon.org>
+Eunchong Yu <kroisse@gmail.com>
 Evan McClanahan <evan@evanmcc.com>
 Fabrice Desré <fabrice@desre.org>
 Fedor Indutny <fedor.indutny@gmail.com>
+Felix Crux <felixc@felixcrux.com>
 Felix S. Klock II <pnkfelix@pnkfx.org>
 Flaper Fesp <flaper87@gmail.com>
 Flavio Percoco <flaper87@gmail.com>
@@ -133,8 +165,11 @@ Gábor Horváth <xazax.hun@gmail.com>
 Gabriel <g2p.code@gmail.com>
 Gareth Daniel Smith <garethdanielsmith@gmail.com>
 Gary Linscott <glinscott@gmail.com>
+Gary M. Josack <gary@byoteki.com>
+gentlefolk <cemacken@gmail.com>
 Geoff Hill <geoff@geoffhill.org>
 Geoffroy Couprie <geo.couprie@gmail.com>
+George Papanikolaou <g3orge.app@gmail.com>
 Georges Dubus <georges.dubus@gmail.com>
 gifnksm <makoto.nksm@gmail.com>
 Glenn Willen <gwillen@nerdnet.org>
@@ -150,6 +185,8 @@ hansjorg <hansjorg@gmail.com>
 Harry Marr <harry.marr@gmail.com>
 Heather <heather@cynede.net>
 Herman J. Radtke III <hermanradtke@gmail.com>
+HeroesGrave <heroesgrave@gmail.com>
+Hong Chulju <ang0123dev@gmail.com>
 Huon Wilson <dbau.pp+github@gmail.com>
 Ian D. Bollinger <ian.bollinger@gmail.com>
 Ian Daniher <it.daniher@gmail.com>
@@ -157,18 +194,23 @@ Igor Bukanov <igor@mir2.org>
 Ilyong Cho <ilyoan@gmail.com>
 Isaac Aggrey <isaac.aggrey@gmail.com>
 Isaac Dupree <antispam@idupree.com>
+Ivan Enderlin <ivan.enderlin@hoa-project.net>
 Ivano Coppola <rgbfirefox@gmail.com>
 Jack Moffitt <jack@metajack.im>
+Jag Talon <talon.jag@gmail.com>
 Jacob Harris Cryer Kragh <jhckragh@gmail.com>
 Jacob Parker <j3parker@csclub.uwaterloo.ca>
 Jaemin Moon <jaemin.moon@samsung.com>
+Jake Kerr <kodafox@gmail.com>
 Jakub <jakub@jakub.cc>
 Jakub Wieczorek <jakubw@jakubw.net>
+James Deng <cnjamesdeng@gmail.com>
 James Miller <bladeon@gmail.com>
 James Tranovich <james@openhorizonlabs.com>
 Jan Kobler <eng1@koblersystems.de>
 Jan Niklas Hasse <jhasse@gmail.com>
 Jannis Harder <jix@jixco.de>
+Jason Fager <jfager@gmail.com>
 Jason Orendorff <jorendorff@mozilla.com>
 Jason Toffaletti <jason@topsy.com>
 Jay Anderson <jayanderson0@gmail.com>
@@ -179,6 +221,7 @@ Jeff Olson <olson.jeffery@gmail.com>
 Jeffrey Yasskin <jyasskin@gmail.com>
 Jeong YunWon <jeong@youknowone.org>
 Jens Nockert <jens@nockert.se>
+Jeremy Letang <letang.jeremy@gmail.com>
 Jesse Jones <jesse9jones@gmail.com>
 Jesse Luehrs <doy@tozt.net>
 Jesse Ruderman <jruderman@gmail.com>
@@ -188,14 +231,19 @@ Jimmy Lu <jimmy.lu.2011@gmail.com>
 Jimmy Zelinskie <jimmyzelinskie@gmail.com>
 J. J. Weber <jjweber@gmail.com>
 jmgrosen <jmgrosen@gmail.com>
+joaoxsouls <joaoxsouls@gmail.com>
 Joe Pletcher <joepletcher@gmail.com>
 Joe Schafer <joe@jschaf.com>
+Johannes Löthberg <johannes@kyriasis.com>
+Johannes Muenzel <jmuenzel@gmail.com>
 John Barker <jebarker@gmail.com>
 John Clements <clements@racket-lang.org>
 John Louis Walker <injyuw@gmail.com>
 Jon Morton <jonanin@gmail.com>
+Jonathan S <gereeter@gmail.com>
 Jonathan Sternberg <jonathansternberg@gmail.com>
 Jordi Boggiano <j.boggiano@seld.be>
+Jorge Aparicio <japaric@linux.com>
 Josh Matthews <josh@joshmatthews.net>
 Joshua Clark <joshua.clark@txstate.edu>
 Joshua Wise <joshua@joshuawise.com>
@@ -206,6 +254,7 @@ Jyun-Yan You <jyyou@cs.nctu.edu.tw>
 Kang Seonghoon <kang.seonghoon@mearie.org>
 Keegan McAllister <kmcallister@mozilla.com>
 Kelly Wilson <wilsonk@cpsc.ucalgary.ca>
+Keshav Kini <keshav.kini@gmail.com>
 Kevin Atkinson <kevina@cs.utah.edu>
 Kevin Ballard <kevin@sb.org>
 Kevin Cantu <me@kevincantu.org>
@@ -214,6 +263,7 @@ Kevin Murphy <kemurphy.cmu@gmail.com>
 Kiet Tran <ktt3ja@gmail.com>
 klutzy <klutzytheklutzy@gmail.com>
 korenchkin <korenchkin2@gmail.com>
+kvark <kvarkus@gmail.com>
 Kyeongwoon Lee <kyeongwoon.lee@samsung.com>
 Lars Bergstrom <lbergstrom@mozilla.com>
 Laurent Bonnans <bonnans.l@gmail.com>
@@ -222,8 +272,11 @@ Leah Hanson <astrieanna@gmail.com>
 Lee Wondong <wdlee91@gmail.com>
 Léo Testard <leo.testard@gmail.com>
 Lennart Kudling <github@kudling.de>
+Liigo Zhuang <com.liigo@gmail.com>
 Lindsey Kuper <lindsey@composition.al>
+lpy <pylaurent1314@gmail.com>
 Luca Bruno <lucab@debian.org>
+lucy <ne.tetewi@gmail.com>
 Luis de Bethencourt <luis@debethencourt.com>
 Luqman Aden <laden@csclub.uwaterloo.ca>
 lyuts <dioxinu@gmail.com>
@@ -231,6 +284,7 @@ Magnus Auvinen <magnus.auvinen@gmail.com>
 Mahmut Bulut <mahmutbulut0@gmail.com>
 maikklein <maikklein@googlemail.com>
 Makoto Nakashima <makoto.nksm+github@gmail.com>
+Marcel Rodrigues <marcelgmr@gmail.com>
 Margaret Meyerhofer <mmeyerho@andrew.cmu.edu>
 Marijn Haverbeke <marijnh@gmail.com>
 Mark Lacey <641@rudkx.com>
@@ -246,27 +300,39 @@ Matthew Auld <matthew.auld@intel.com>
 Matthew Iselin <matthew@theiselins.net>
 Matthew McPherrin <matthew@mcpherrin.ca>
 Matthew O'Connor <thegreendragon@gmail.com>
+Matthias Einwag <matthias.einwag@live.com>
 Matthijs Hofstra <thiezz@gmail.com>
+Matthijs van der Vleuten <git@zr40.nl>
 Max Penet <max.penet@gmail.com>
 Maxim Kolganov <kolganov.mv@gmail.com>
 Micah Chalmer <micah@micahchalmer.net>
 Michael Arntzenius <daekharel@gmail.com>
 Michael Bebenita <mbebenita@mozilla.com>
+Michael Darakananda <pongad@gmail.com>
 Michael Letterle <michael.letterle@gmail.com>
 Michael Neumann <mneumann@ntecs.de>
 Michael Sullivan <sully@msully.net>
 Michael Williams <m.t.williams@live.com>
 Michael Woerister <michaelwoerister@gmail>
+Mickaël Delahaye <mickael.delahaye@gmail.com>
 Mihnea Dobrescu-Balaur <mihnea@linux.com>
+Mike Boutin <mike.boutin@gmail.com>
 Mikko Perttunen <cyndis@kapsi.fi>
+mr.Shu <mr@shu.io>
+Ms2ger <ms2ger@gmail.com>
 Mukilan Thiagarajan <mukilanthiagarajan@gmail.com>
+musitdev <philippe.delrieu@free.fr>
+Nathaniel Herman <nherman@college.harvard.edu>
+Nick Cameron <ncameron@mozilla.com>
 Nick Desaulniers <ndesaulniers@mozilla.com>
 Nif Ward <nif.ward@gmail.com>
 Niko Matsakis <niko@alum.mit.edu>
+noam <noam@clusterfoo.com>
 Noufal Ibrahim <noufal@nibrahim.net.in>
 novalis <novalis@novalis.org>
 Ogino Masanori <masanori.ogino@gmail.com>
 Olivier Saut <osaut@airpost.net>
+Olle Jonsson <olle.jonsson@gmail.com>
 Or Brostovski <tohava@gmail.com>
 Orphée Lafond-Lummis <o@orftz.com>
 osa1 <omeragacan@gmail.com>
@@ -278,14 +344,20 @@ Paul Stansifer <paul.stansifer@gmail.com>
 Paul Woolcock <pwoolcoc+github@gmail.com>
 Pavel Panchekha <me@pavpanchekha.com>
 Peter Hull <peterhull90@gmail.com>
+Peter Marheine <peter@taricorp.net>
 Peter Williams <peter@newton.cx>
 Peter Zotov <whitequark@whitequark.org>
+Petter Remen <petter.remen@gmail.com>
 Philipp Brüschweiler <blei42@gmail.com>
+Piotr Czarnecki <pioczarn@gmail.com>
+Piotr Zolnierek <pz@anixe.pl>
 Pradeep Kumar <gohanpra@gmail.com>
+Q.P.Liu <qpliu@yahoo.com>
 Rafael Ávila de Espíndola <respindola@mozilla.com>
 Ralph Bodenner <rkbodenner+github@gmail.com>
 Ralph Giles <giles@thaumas.net>
 Ramkumar Ramachandra <artagnon@gmail.com>
+Raphael Catolino <raphael.catolino@gmail.com>
 Raphael Speyer <rspeyer@gmail.com>
 reedlepee <reedlepee123@gmail.com>
 Reuben Morais <reuben.morais@gmail.com>
@@ -293,6 +365,7 @@ Richard Diamond <wichard@vitalitystudios.com>
 Rick Waldron <waldron.rick@gmail.com>
 Rob Arnold <robarnold@cs.cmu.edu>
 Rob Hoelz <rob@hoelz.ro>
+Robert Gawdzik <rgawdzik@hotmail.com>
 Robert Irelan <rirelan@gmail.com>
 Robert Knight <robertknight@gmail.com>
 Robert Millar <robert.millar@cantab.net>
@@ -300,12 +373,16 @@ Roland Tanglao <roland@rolandtanglao.com>
 Ron Dahlgren <ronald.dahlgren@gmail.com>
 Roy Frostig <rfrostig@mozilla.com>
 Ryan Scheel <ryan.havvy@gmail.com>
+Salem Talha <salem.a.talha@gmail.com>
 Samuel Chase <samebchase@gmail.com>
 Sander Mathijs van Veen <smvv@kompiler.org>
 Sangeun Kim <sammy.kim@samsung.com>
 Sankha Narayan Guria <sankha93@gmail.com>
 Saurabh Anand <saurabhanandiit@gmail.com>
+Scott Jenkins <scottdjwales@gmail.com>
 Scott Lawrence <bytbox@gmail.com>
+Sean Chalmers <sclhiannan@gmail.com>
+Sean McArthur <sean.monstar@gmail.com>
 Sean Moon <ssamoon@ucla.edu>
 Sean Stangl <sstangl@mozilla.com>
 Sebastian N. Fernandez <cachobot@gmail.com>
@@ -316,6 +393,7 @@ Seth Pink <sethpink@gmail.com>
 Seo Sanghyeon <sanxiyn@gmail.com>
 Seonghyun Kim <sh8281.kim@samsung.com>
 sevrak <sevrak@rediffmail.com>
+Shamir Khodzha <khodzha.sh@gmail.com>
 SiegeLord <slabode@aim.com>
 Simon Barber-Dueck <sbarberdueck@gmail.com>
 Simon Sapin <simon@exyr.org>
@@ -323,6 +401,7 @@ sp3d <sp3d@github>
 startling <tdixon51793@gmail.com>
 Stefan Plantikow <stefan.plantikow@googlemail.com>
 Stepan Koltsov <stepan.koltsov@gmail.com>
+Sterling Greene <sterling.greene@gmail.com>
 Steve Klabnik <steve@steveklabnik.com>
 Steven De Coeyer <steven@banteng.be>
 Steven Fackler <sfackler@gmail.com>
@@ -335,11 +414,14 @@ Thomas Daede <daede003@umn.edu>
 Tim Chevalier <chevalier@alum.wellesley.edu>
 Tim Kuehn <tkuehn@cmu.edu>
 Tim Taubert <tim@timtaubert.de>
+Tobias Bucher <tobiasbucher5991@gmail.com>
 Tom Lee <github@tomlee.co>
 Tomas Sedovic <tomas@sedovic.cz>
 Tommy M. McGuire <mcguire@crsr.net>
 Tomoki Aonuma <uasi@99cm.org>
 Tony Young <tony@rfw.name>
+Torsten Weber <TorstenWeber12@gmail.com>
+Trent Ogren <tedwardo2@gmail.com>
 Trinick <slicksilver555@mac.com>
 Tycho Sci <tychosci@gmail.com>
 Tyler Bindon <martica@martica.org>
@@ -349,16 +431,22 @@ Vadim Chugunov <vadimcn@gmail.com>
 Vijay Korapaty <rust@korapaty.com>
 Viktor Dahl <pazaconyoman@gmail.com>
 Vincent Belliard <vincent@famillebelliard.fr>
+Virgile Andreani <virgile.andreani@anbuco.fr>
 Vivek Galatage <vivekgalatage@gmail.com>
 Volker Mische <volker.mische@gmail.com>
 Wade Mealing <wmealing@gmail.com>
+WebeWizard <webewizard@gmail.com>
 William Ting <io@williamting.com>
+xales <xales@naveria.com>
+Yehuda Katz <wycats@gmail.com>
 Yasuhiro Fujii <y-fujii@mimosa-pudica.net>
 Young-il Choi <duddlf.choi@samsung.com>
 Youngmin Yoo <youngmin.yoo@samsung.com>
 Youngsoo Son <ysson83@gmail.com>
+Yuri Kunde Schlesner <yuriks@yuriks.net>
 Zach Kamsler <smoo.master@gmail.com>
 Zack Corr <zack@z0w0.me>
 Zack Slayton <zack.slayton@gmail.com>
 Ziad Hatahet <hatahet@gmail.com>
 zofrex <zofrex@gmail.com>
+zslayton <zack.slayton@gmail.com>
index 1d098571bae4ea8b429eb7dc40d55eef82be9ded..a25d916d931e934d35854d73170f2c04a3717597 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,20 +5,19 @@ documentation.
 
 ## Quick Start
 
-### Windows
-
-1. Download and use the [installer and MinGW][win-wiki].
+1. Download a [binary insaller][installer] for your platform.
 2. Read the [tutorial].
-2. Enjoy!
+3. Enjoy!
 
 > ***Note:*** Windows users can read the detailed
 > [getting started][wiki-start] notes on the wiki.
 
+[installer]: http://www.rust-lang.org/install.html
 [tutorial]: http://static.rust-lang.org/doc/tutorial.html
 [wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
 [win-wiki]: https://github.com/mozilla/rust/wiki/Using-Rust-on-Windows
 
-### Linux / OS X
+## Building from Source
 
 1. Make sure you have installed the dependencies:
     * `g++` 4.4 or `clang++` 3.x
@@ -32,9 +31,9 @@ documentation.
 
     To build from the [tarball] do:
 
-        $ curl -O http://static.rust-lang.org/dist/rust-0.9.tar.gz
-        $ tar -xzf rust-0.9.tar.gz
-        $ cd rust-0.9
+        $ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz
+        $ tar -xzf rust-nightly.tar.gz
+        $ cd rust-nightly
 
     Or to build from the [repo] do:
 
@@ -59,8 +58,8 @@ documentation.
 4. Enjoy!
 
 [repo]: https://github.com/mozilla/rust
-[tarball]: http://static.rust-lang.org/dist/rust-0.9.tar.gz
-[tutorial]: http://static.rust-lang.org/doc/0.9/tutorial.html
+[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
+[tutorial]: http://static.rust-lang.org/doc/nightly/tutorial.html
 
 ## Notes
 
index b3eb4834930d4af21dfc4de765c43266fe8b9363..8fc6828ced18b1ac09693a164b61fa0083741204 100644 (file)
@@ -1,4 +1,4 @@
-.TH RUSTC "1" "March 2014" "rustc 0.10-pre" "User Commands"
+.TH RUSTC "1" "March 2014" "rustc 0.11-pre" "User Commands"
 .SH NAME
 rustc \- rust compiler
 .SH SYNOPSIS
index 4933794d95ccb80b518f07eb5a98de2f8b3c1e0d..bf0b6a95187919bd19cc652b26b6fc9835fde9a1 100644 (file)
@@ -1,4 +1,4 @@
-.TH RUSTDOC "1" "March 2014" "rustdoc 0.10-pre" "User Commands"
+.TH RUSTDOC "1" "March 2014" "rustdoc 0.11-pre" "User Commands"
 .SH NAME
 rustdoc \- generate documentation from Rust source code
 .SH SYNOPSIS
index 2f9c4afb9b78f3e659a3ffecac44b7d1062d4f2d..fab828571cd4f508a97f4032b4332a131004b3cb 100644 (file)
@@ -271,7 +271,7 @@ endif
 $(2) += doc/$(1)/index.html
 doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1))
        @$$(call E, rustdoc $$@)
-       $$(Q)$$(RUSTDOC) --cfg stage2 $$<
+       $$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
 endef
 
 $(foreach crate,$(DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),DOC_TARGETS)))
index f59a553d783bad58beceeac63a4c26b522148b09..fa19a4b380ec6bdf4fa05443fa09e332aff233d1 100644 (file)
@@ -13,7 +13,7 @@
 ######################################################################
 
 # The version number
-CFG_RELEASE_NUM=0.10
+CFG_RELEASE_NUM=0.11
 CFG_RELEASE_LABEL=-pre
 
 ifndef CFG_ENABLE_NIGHTLY
index 7fd6d148f3863befe79e59c0df0ccd6ee9aae9ae..5860c2f252cbdeecda59204fdc1471840eecf67a 100644 (file)
@@ -694,7 +694,7 @@ endif
 ifeq ($(2),$$(CFG_BUILD))
 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
        @$$(call E, run doc-$(4) [$(2)])
-       $$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test $$< --test-args "$$(TESTARGS)" && touch $$@
+       $$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< --test-args "$$(TESTARGS)" && touch $$@
 else
 $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
        touch $$@
index e00b864f2e9ebf892d4deab3467911edceefe250..34918e391828955b021afe8955db842bf4f68fe4 100644 (file)
 use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
 
 #[cfg(target_os = "win32")]
-fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
-
-    let mut env = os::env();
+fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
+    let env = os::env();
 
     // Make sure we include the aux directory in the path
     assert!(prog.ends_with(".exe"));
     let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
 
-    env = env.map(|pair| {
-        let (k,v) = (*pair).clone();
-        if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
-        else { (k,v) }
-    });
+    let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
+        let new_v = if "PATH" == k {
+            format!("{};{};{}", v, lib_path, aux_path)
+        } else {
+            v
+        };
+        (k, new_v)
+    }).collect();
     if prog.ends_with("rustc.exe") {
-        env.push((~"RUST_THREADS", ~"1"));
+        new_env.push((~"RUST_THREADS", ~"1"));
     }
-    return env;
+    return new_env;
 }
 
 #[cfg(target_os = "linux")]
index b07588a914d12bed0c36b3d97fbacc0f0b37cc8f..e057909a06cd01c27981b7ca9da5f9a14b7f2277 100644 (file)
@@ -529,7 +529,7 @@ fn to_lower( s : &str ) -> ~str {
                 c
             }
         } ).collect();
-        str::from_chars( c )
+        str::from_chars(c.as_slice())
     }
 
     #[cfg(target_os = "win32")]
index be0938022d2cc28f22346332dcd9e15673334fc1..40980ee05604bd562e2eaaa276c810121744f4cf 100644 (file)
@@ -53,12 +53,12 @@ To generate .pot and .po files, do something like:
 ~~~~
 po4a --copyright-holder="The Rust Project Developers" \
     --package-name="Rust" \
-    --package-version="0.10-pre" \
+    --package-version="0.11-pre" \
     -M UTF-8 -L UTF-8 \
     src/doc/po4a.conf
 ~~~~
 
-(the version number must be changed if it is not 0.10-pre now.)
+(the version number must be changed if it is not 0.11-pre now.)
 
 Now you can translate documents with .po files, commonly used with gettext. If
 you are not familiar with gettext-based translation, please read the online
index 72ef1d5a0102bd840b99945074fd7bb6a60a8ff0..55dfacfe51e35ed9669e50a9ca222e0e0b316564 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
@@ -20,14 +20,14 @@ msgstr ""
 #: src/doc/complement-cheatsheet.md:8
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use [`ToStr`](http://static.rust-lang.org/doc/master/std/to_str/trait.ToStr."
 "html)."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:13
@@ -46,15 +46,15 @@ msgstr ""
 #: src/doc/complement-cheatsheet.md:17
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use [`FromStr`](http://static.rust-lang.org/doc/master/std/from_str/trait."
 "FromStr.html), and its helper function, [`from_str`](http://static.rust-lang."
 "org/doc/master/std/from_str/fn.from_str.html)."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:22
@@ -73,14 +73,14 @@ msgstr ""
 #: src/doc/complement-cheatsheet.md:26
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use [`ToStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait."
 "ToStrRadix.html)."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:29
@@ -108,15 +108,15 @@ msgstr ""
 #: src/doc/complement-cheatsheet.md:37
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use [`FromStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait."
 "FromStrRadix.html), and its helper function, [`from_str_radix`](http://"
 "static.rust-lang.org/doc/master/std/num/fn.from_str_radix.html)."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:40
@@ -153,16 +153,16 @@ msgstr "## 演算子"
 #: src/doc/complement-cheatsheet.md:50
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use [`File::open`](http://static.rust-lang.org/doc/master/std/io/fs/struct."
 "File.html#method.open) to create a [`File`](http://static.rust-lang.org/doc/"
 "master/std/io/fs/struct.File.html) struct, which implements the [`Reader`]"
 "(http://static.rust-lang.org/doc/master/std/io/trait.Reader.html) trait."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:54
@@ -177,15 +177,15 @@ msgstr ""
 #: src/doc/complement-cheatsheet.md:63
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer."
 "html#method.lines) method on a [`BufferedReader`](http://static.rust-lang."
 "org/doc/master/std/io/buffered/struct.BufferedReader.html)."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:67
@@ -207,14 +207,14 @@ msgstr "## 他のクレートの利用"
 #: src/doc/complement-cheatsheet.md:81
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use the [`find_str`](http://static.rust-lang.org/doc/master/std/str/trait."
 "StrSlice.html#tymethod.find_str) method."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:88 src/doc/guide-container.md:4
@@ -226,34 +226,34 @@ msgstr "## 本書の表記について"
 #: src/doc/complement-cheatsheet.md:92
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "The [`Container`](http://static.rust-lang.org/doc/master/std/container/trait."
 "Container.html) trait provides the `len` method."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:104
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "Use the [`iter`](http://static.rust-lang.org/doc/master/std/vec/trait."
 "ImmutableVector.html#tymethod.iter) method."
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:113
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "(See also [`mut_iter`](http://static.rust-lang.org/doc/master/std/vec/trait."
 "MutableVector.html#tymethod.mut_iter) which yields `&mut int` and "
@@ -261,8 +261,8 @@ msgid ""
 "OwnedVector.html#tymethod.move_iter) which yields `int` while consuming the "
 "`values` vector.)"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/complement-cheatsheet.md:115 src/doc/rust.md:3019
index 02dee63f312e7f8aa27457a2b0781c3ecb558417..1f324ac2a9e8e2bae1e540ac1260e229d7950056 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 190f88cf80d346c3f7faa372ecfbf22963918e8b..5060a77a128d62cbe16871fe7a19a3b1c86251be 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 9ffdd7b1f43617f1f3672d680a016e2891eec582..aa3ed6effa00d38f222e52511e39dff05bbb401b 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-02-03 08:13+0900\n"
 "Last-Translator: Automatically generated\n"
@@ -27,9 +27,9 @@ msgstr "## 構造体"
 #: src/doc/complement-usage-faq.md:18
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid "[1]:http://doc.rust-lang.org/doc/master/rust.html#logging-system"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
index a65d6eec4198cbc2f2843f34e147d8e5ab25d3b8..0e84562c22cdde7c8e509fb1d0f70c31045c3927 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 23e1c7734f0b478d2a9a298b0ebbff508afb195c..035a482cad9dff231a89d25e01c4b72206b4c544 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 3155b9f65053f9d81358def0fd9216df1a5fbb8d..6c5f56bfedc9127bc9dae3a0581cd9900c9cfb27 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index bbe4b3a4a856b61f7ee3f3e9c7aa7bc32fd0d6e3..5d7246ede476edf633bc31b5ccdca48ac8607ff0 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 82b0d20d5e507956342d594ee039fc05ad7daf91..5501b98f6e950ca6304d6b5849741a916f7b5991 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 2b130821c4c9ab6a1e9394ebcc6ba46cf63dea32..0e421f5c7b14db36f0ecd2b453293775cf10cc4f 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 2e02fe344ebaf82c4a8c8e48b25ed801e34e177b..c85dd997c4307a45ce83966dc66267dfe0cf1f75 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-02-03 08:13+0900\n"
 "Last-Translator: Automatically generated\n"
index ab761ca4ea79d8ec494262e8c8e0ba0c3090ae7e..6fbb80f0fa56c3499ba2b3f6110d2744bc29b737 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 6ec1a4467da86bdb187f4838703145c719082b6d..e4d123c8118d45deadcab2dfd1ecbf87c7f963b9 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 7bf6868ceed00ba59613f81946d925e99f3f477b..afe30505c8c201e3c057b49041a845ec502941d5 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-14 21:02+0900\n"
 "Last-Translator: Automatically generated\n"
index e0d89edaa020eacebc57085231aec96e6033ded8..d775929df5db274d6420b9f0a280760b738e7d3c 100644 (file)
@@ -5,7 +5,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Rust 0.10-pre\n"
+"Project-Id-Version: Rust 0.11-pre\n"
 "POT-Creation-Date: 2014-02-03 08:13+0900\n"
 "PO-Revision-Date: 2014-01-13 12:01+0900\n"
 "Last-Translator: Automatically generated\n"
index 2646460346b56d57cb945accd711e899753ac46a..f17d3df9c1cf291000ca6f6c998238cfaf0ddc0d 100644 (file)
@@ -356,17 +356,17 @@ msgstr "上記条件を満たしていれば、以下のような手順でビル
 #: src/doc/tutorial.md:112
 #, fuzzy
 #| msgid ""
-#| "~~~~ {.notrust} $ curl -O http://static.rust-lang.org/dist/rust-0.7.tar."
-#| "gz $ tar -xzf rust-0.7.tar.gz $ cd rust-0.7 $ ./configure $ make && make "
+#| "~~~~ {.notrust} $ curl -O http://static.rust-lang.org/dist/rust-nightly.tar."
+#| "gz $ tar -xzf rust-nightly.tar.gz $ cd rust-nightly $ ./configure $ make && make "
 #| "install ~~~~"
 msgid ""
-"~~~~ {.notrust} $ curl -O http://static.rust-lang.org/dist/rust-0.9.tar.gz $ "
-"tar -xzf rust-0.9.tar.gz $ cd rust-0.9 $ ./configure $ make && make install "
+"~~~~ {.notrust} $ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz $ "
+"tar -xzf rust-nightly.tar.gz $ cd rust-nightly $ ./configure $ make && make install "
 "~~~~"
 msgstr ""
 "~~~~ {.notrust}\n"
-"$ curl -O http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"$ tar -xzf rust-0.7.tar.gz $ cd rust-0.7 $ ./configure\n"
+"$ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"$ tar -xzf rust-nightly.tar.gz $ cd rust-nightly $ ./configure\n"
 "$ make && make install\n"
 "~~~~"
 
@@ -405,14 +405,14 @@ msgstr ""
 #: src/doc/tutorial.md:125
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.9.tar.gz [win-exe]: "
-"http://static.rust-lang.org/dist/rust-0.9-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+"http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/tutorial.md:127
@@ -1002,14 +1002,14 @@ msgstr ""
 #: src/doc/tutorial.md:385
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "[transmute]: http://static.rust-lang.org/doc/master/std/cast/fn.transmute."
 "html"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/tutorial.md:387
@@ -1078,14 +1078,14 @@ msgstr ""
 #: src/doc/tutorial.md:412
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "[pf]: http://en.cppreference.com/w/cpp/io/c/fprintf [fmt]: http://static."
 "rust-lang.org/doc/master/std/fmt/index.html"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/tutorial.md:416
@@ -2161,14 +2161,14 @@ msgstr ""
 #: src/doc/tutorial.md:944
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "[gc]: http://static.rust-lang.org/doc/master/std/gc/struct.Gc.html [rc]: "
 "http://static.rust-lang.org/doc/master/std/rc/struct.Rc.html"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/tutorial.md:946
@@ -2553,14 +2553,14 @@ msgstr ""
 #: src/doc/tutorial.md:1461
 #, fuzzy
 #| msgid ""
-#| "[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz [win-exe]: "
-#| "http://static.rust-lang.org/dist/rust-0.7-install.exe"
+#| "[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz [win-exe]: "
+#| "http://static.rust-lang.org/dist/rust-nightly-install.exe"
 msgid ""
 "[refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell."
 "html"
 msgstr ""
-"[tarball]: http://static.rust-lang.org/dist/rust-0.7.tar.gz\n"
-"[win-exe]: http://static.rust-lang.org/dist/rust-0.7-install.exe"
+"[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz\n"
+"[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe"
 
 #. type: Plain text
 #: src/doc/tutorial.md:1463
index 9e211dda2fb409f6c2e5ea9f619adf580eb02936..f73b40a3ff47e396edd99216c87f64ce2125ef70 100644 (file)
@@ -610,20 +610,20 @@ and may optionally begin with any number of `attributes` that apply to the conta
 Attributes on the anonymous crate module define important metadata that influences
 the behavior of the compiler.
 
-~~~~
-// Package ID
-#[ crate_id = "projx#2.5" ];
+~~~~ {.rust}
+// Crate ID
+#![crate_id = "projx#2.5"]
 
 // Additional metadata attributes
-#[ desc = "Project X" ];
-#[ license = "BSD" ];
-#[ comment = "This is a comment on Project X." ];
+#![desc = "Project X"]
+#![license = "BSD"]
+#![comment = "This is a comment on Project X."]
 
 // Specify the output type
-#[ crate_type = "lib" ];
+#![crate_type = "lib"]
 
 // Turn on a warning
-#[ warn(non_camel_case_types) ];
+#![warn(non_camel_case_types)]
 ~~~~
 
 A crate that contains a `main` function can be compiled to an executable.
@@ -792,7 +792,7 @@ extern crate std; // equivalent to: extern crate std = "std";
 
 extern crate ruststd = "std"; // linking to 'std' under another name
 
-extern crate foo = "some/where/rust-foo#foo:1.0"; // a full package ID for external tools
+extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for external tools
 ~~~~
 
 ##### Use declarations
@@ -875,7 +875,7 @@ and `extern crate` declarations.
 An example of what will and will not work for `use` items:
 
 ~~~~
-# #[allow(unused_imports)];
+# #![allow(unused_imports)]
 use foo::native::start;  // good: foo is at the root of the crate
 use foo::baz::foobaz;    // good: foo is at the root of the crate
 
@@ -1505,11 +1505,9 @@ specified name.
 extern { }
 ~~~~
 
-The type of a function
-declared in an extern block
-is `extern "abi" fn(A1, ..., An) -> R`,
-where `A1...An` are the declared types of its arguments
-and `R` is the decalred return type.
+The type of a function declared in an extern block is `extern "abi" fn(A1,
+..., An) -> R`, where `A1...An` are the declared types of its arguments and
+`R` is the declared return type.
 
 ## Visibility and Privacy
 
@@ -1680,77 +1678,139 @@ import public items from their destination, not private items.
 ## Attributes
 
 ~~~~ {.notrust .ebnf .gram}
-attribute : '#' '[' attr_list ']' ;
+attribute : '#' '!' ? '[' attr_list ']' ;
 attr_list : attr [ ',' attr_list ]* ;
 attr : ident [ '=' literal
              | '(' attr_list ')' ] ? ;
 ~~~~
 
 Static entities in Rust -- crates, modules and items -- may have _attributes_
-applied to them. ^[Attributes in Rust are modeled on Attributes in ECMA-335,
-C#]
-An attribute is a general, free-form metadatum that is interpreted according to name, convention, and language and compiler version.
-Attributes may appear as any of
+applied to them. Attributes in Rust are modeled on Attributes in ECMA-335,
+with the syntax coming from ECMA-334 (C#). An attribute is a general,
+free-form metadatum that is interpreted according to name, convention, and
+language and compiler version. Attributes may appear as any of:
 
 * A single identifier, the attribute name
-* An identifier followed by the equals sign '=' and a literal, providing a key/value pair
+* An identifier followed by the equals sign '=' and a literal, providing a
+  key/value pair
 * An identifier followed by a parenthesized list of sub-attribute arguments
 
-Attributes terminated by a semi-colon apply to the entity that the attribute is declared
-within. Attributes that are not terminated by a semi-colon apply to the next entity.
+Attributes with a bang ("!") after the hash ("#") apply to the item that the
+attribute is declared within. Attributes that do not have a bang after the
+hash apply to the item that follows the attribute.
 
 An example of attributes:
 
-~~~~ {.ignore}
+~~~~ {.rust}
 // General metadata applied to the enclosing module or crate.
-#[license = "BSD"];
+#![license = "BSD"]
 
 // A function marked as a unit test
 #[test]
 fn test_foo() {
-  ...
+  /* ... */
 }
 
 // A conditionally-compiled module
 #[cfg(target_os="linux")]
 mod bar {
-  ...
+  /* ... */
 }
 
 // A lint attribute used to suppress a warning/error
 #[allow(non_camel_case_types)]
-pub type int8_t = i8;
-~~~~
-
-> **Note:** In future versions of Rust, user-provided extensions to the compiler
-> will be able to interpret attributes.  When this facility is provided, the
-> compiler will distinguish between language-reserved and user-available
-> attributes.
-
-At present, only the Rust compiler interprets attributes, so all attribute names
-are effectively reserved. Some significant attributes include:
-
-* The `doc` attribute, for documenting code in-place.
-* The `cfg` attribute, for conditional-compilation by build-configuration (see
-  [Conditional compilation](#conditional-compilation)).
-* The `crate_id` attribute, for describing the package ID of a crate.
-* The `lang` attribute, for custom definitions of traits and functions that are
-  known to the Rust compiler (see [Language items](#language-items)).
-* The `link` attribute, for describing linkage metadata for a extern blocks.
-* The `test` attribute, for marking functions as unit tests.
-* The `allow`, `warn`, `forbid`, and `deny` attributes, for
-  controlling lint checks (see [Lint check attributes](#lint-check-attributes)).
-* The `deriving` attribute, for automatically generating implementations of
-  certain traits.
-* The `inline` attribute, for expanding functions at caller location (see
-  [Inline attributes](#inline-attributes)).
-* The `static_assert` attribute, for asserting that a static bool is true at
-  compiletime.
-* The `thread_local` attribute, for defining a `static mut` as a thread-local.
-  Note that this is only a low-level building block, and is not local to a
-  *task*, nor does it provide safety.
-
-Other attributes may be added or removed during development of the language.
+type int8_t = i8;
+~~~~
+
+> **Note:** At some point in the future, the compiler will distinguish between
+> language-reserved and user-available attributes. Until then, there is
+> effectively no difference between an attribute handled by a loadable syntax
+> extension and the compiler.
+
+### Crate-only attributes
+
+- `crate_id` - specify the this crate's crate ID.
+- `crate_type` - see [linkage](#linkage).
+- `feature` - see [compiler features](#compiler-features).
+- `no_main` - disable emitting the `main` symbol. Useful when some other
+  object being linked to defines `main`.
+- `no_start` - disable linking to the `native` crate, which specifies the
+  "start" language item.
+- `no_std` - disable linking to the `std` crate.
+
+### Module-only attributes
+
+- `macro_escape` - macros defined in this module will be visible in the
+  module's parent, after this module has been included.
+- `no_implicit_prelude` - disable injecting `use std::prelude::*` in this
+  module.
+- `path` - specifies the file to load the module from. `#[path="foo.rs"] mod
+  bar;` is equivalent to `mod bar { /* contents of foo.rs */ }`. The path is
+  taken relative to the directory that the current module is in.
+
+### Function-only attributes
+
+- `macro_registrar` - when using loadable syntax extensions, mark this
+  function as the registration point for the current crate's syntax
+  extensions.
+- `main` - indicates that this function should be passed to the entry point,
+  rather than the function in the crate root named `main`.
+- `start` - indicates that this function should be used as the entry point,
+  overriding the "start" language item.  See the "start" [language
+  item](#language-items) for more details.
+
+### Static-only attributes
+
+- `address_insignificant` - references to this static may alias with
+  references to other statics, potentially of unrelated type.
+- `thread_local` - on a `static mut`, this signals that the value of this
+  static may change depending on the current thread. The exact consequences of
+  this are implementation-defined.
+
+### FFI attributes
+
+On an `extern` block, the following attributes are interpreted:
+
+- `link_args` - specify arguments to the linker, rather than just the library
+  name and type. This is feature gated and the exact behavior is
+  implementation-defined (due to variety of linker invocation syntax).
+- `link` - indicate that a native library should be linked to for the
+  declarations in this block to be linked correctly. See [external
+  blocks](#external-blocks)
+
+On declarations inside an `extern` block, the following attributes are
+interpreted:
+
+- `link_name` - the name of the symbol that this function or static should be
+  imported as.
+- `linkage` - on a static, this specifies the [linkage
+  type](http://llvm.org/docs/LangRef.html#linkage-types).
+
+### Miscellaneous attributes
+
+- `link_section` - on statics and functions, this specifies the section of the
+  object file that this item's contents will be placed into.
+- `macro_export` - export a macro for cross-crate usage.
+- `no_mangle` - on any item, do not apply the standard name mangling. Set the
+  symbol for this item to its identifier.
+- `packed` - on structs or enums, eliminate any padding that would be used to
+  align fields.
+- `repr` - on C-like enums, this sets the underlying type used for
+  representation. Useful for FFI. Takes one argument, which is the primitive
+  type this enum should be represented for, or `C`, which specifies that it
+  should be the default `enum` size of the C ABI for that platform. Note that
+  enum representation in C is undefined, and this may be incorrect when the C
+  code is compiled with certain flags.
+- `simd` - on certain tuple structs, derive the arithmetic operators, which
+  lower to the target's SIMD instructions, if any.
+- `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.
+- `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.
 
 ### Conditional compilation
 
@@ -1792,9 +1852,7 @@ one of `foo` and `bar` to be defined (this resembles in the disjunctive normal
 form). Additionally, one can reverse a condition by enclosing it in a
 `not(...)`, like e. g. `#[cfg(not(target_os = "win32"))]`.
 
-To pass a configuration option which triggers a `#[cfg(identifier)]` one can use
-`rustc --cfg identifier`. In addition to that, the following configurations are
-pre-defined by the compiler:
+The following configurations must be defined by the implementation:
 
  * `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
    `"mips"`, or `"arm"`.
@@ -1806,8 +1864,8 @@ pre-defined by the compiler:
  * `target_os = "..."`. Operating system of the target, examples include
    `"win32"`, `"macos"`, `"linux"`, `"android"` or `"freebsd"`.
  * `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
-   for 32-bit CPU targets, and likewise set to `"64"` for 64-bit CPU targets.
* `test`. Only set in test builds (`rustc --test`).
+   for targets with 32-bit pointers, and likewise set to `"64"` for 64-bit
  pointers.
  * `unix`. See `target_family`.
  * `windows`. See `target_family`.
 
@@ -1823,8 +1881,8 @@ For any lint check `C`:
  * `deny(C)` signals an error after encountering a violation of `C`,
  * `allow(C)` overrides the check for `C` so that violations will go
     unreported,
- * `forbid(C)` is the same as `deny(C)`, but also forbids uses of
-   `allow(C)` within the entity.
+ * `forbid(C)` is the same as `deny(C)`, but also forbids changing the lint
+    level afterwards.
 
 The lint checks supported by the compiler can be found via `rustc -W help`,
 along with their default settings.
@@ -1882,11 +1940,11 @@ mod m3 {
 
 ### Language items
 
-Some primitive Rust operations are defined in Rust code,
-rather than being implemented directly in C or assembly language.
-The definitions of these operations have to be easy for the compiler to find.
-The `lang` attribute makes it possible to declare these operations.
-For example, the `str` module in the Rust standard library defines the string equality function:
+Some primitive Rust operations are defined in Rust code, rather than being
+implemented directly in C or assembly language.  The definitions of these
+operations have to be easy for the compiler to find.  The `lang` attribute
+makes it possible to declare these operations.  For example, the `str` module
+in the Rust standard library defines the string equality function:
 
 ~~~~ {.ignore}
 #[lang="str_eq"]
@@ -1901,16 +1959,23 @@ when generating calls to the string equality function.
 
 A complete list of the built-in language items follows:
 
-#### Traits
+#### Built-in Traits
 
-`const`
-  : Cannot be mutated.
-`owned`
-  : Are uniquely owned.
-`durable`
-  : Contain references.
+`send`
+  : Able to be sent across task boundaries.
+`sized`
+  : Has a size known at compile time.
+`copy`
+  : Types that do not move ownership when used by-value.
+`share`
+  : Able to be safely shared between tasks when aliased.
 `drop`
-  : Have finalizers.
+  : Have destructors.
+
+#### Operators
+
+These language items are traits:
+
 `add`
   : Elements can be added (for example, integers and floats).
 `sub`
@@ -1941,17 +2006,54 @@ A complete list of the built-in language items follows:
   : Elements can be compared for equality.
 `ord`
   : Elements have a partial ordering.
+`deref`
+  : `*` can be applied, yielding a reference to another type
+`deref_mut`
+  : `*` can be applied, yielding a mutable reference to another type
+
 
-#### Operations
+These are functions:
 
 `str_eq`
-  : Compare two strings for equality.
+  : Compare two strings (`&str`) for equality.
 `uniq_str_eq`
-  : Compare two owned strings for equality.
-`annihilate`
-  : Destroy a box before freeing it.
-`log_type`
-  : Generically print a string representation of any type.
+  : Compare two owned strings (`~str`) for equality.
+`strdup_uniq`
+  : Return a new unique string
+    containing a copy of the contents of a unique string.
+
+#### Types
+
+`unsafe`
+  : A type whose contents can be mutated through an immutable reference
+`type_id`
+  : The type returned by the `type_id` intrinsic.
+
+#### Marker types
+
+These types help drive the compiler's analysis
+
+`covariant_type`
+  : The type parameter should be considered covariant
+`contravariant_type`
+  : The type parameter should be considered contravariant
+`invariant_type`
+  : The type parameter should be considered invariant
+`covariant_lifetime`
+  : The lifetime parameter should be considered covariant
+`contravariant_lifetime`
+  : The lifetime parameter should be considered contravariant
+`invariant_lifetime`
+  : The lifetime parameter should be considered invariant
+`no_send_bound`
+  : This type does not implement "send", even if eligible
+`no_copy_bound`
+  : This type does not implement "copy", even if eligible
+`no_share_bound`
+  : This type does not implement "share", even if eligible
+`managed_bound`
+  : This type implements "managed"
+
 `fail_`
   : Abort the program with an error.
 `fail_bounds_check`
@@ -1964,15 +2066,6 @@ A complete list of the built-in language items follows:
   : Allocate memory on the managed heap.
 `free`
   : Free memory that was allocated on the managed heap.
-`borrow_as_imm`
-  : Create an immutable reference to a mutable value.
-`return_to_mut`
-  : Release a reference created with `return_to_mut`
-`check_not_borrowed`
-  : Fail if a value has existing references to it.
-`strdup_uniq`
-  : Return a new unique string
-    containing a copy of the contents of a unique string.
 
 > **Note:** This list is likely to become out of date. We should auto-generate it
 > from `librustc/middle/lang_items.rs`.
@@ -2040,6 +2133,7 @@ Supported traits for `deriving` are:
 * `Show`, to format a value using the `{}` formatter.
 
 ### Stability
+
 One can indicate the stability of an API using the following attributes:
 
 * `deprecated`: This item should no longer be used, e.g. it has been
@@ -2066,7 +2160,7 @@ be unstable for the purposes of the lint. One can give an optional
 string that will be displayed when the lint flags the use of an item.
 
 ~~~~ {.ignore}
-#[warn(unstable)];
+#![warn(unstable)]
 
 #[deprecated="replaced by `best`"]
 fn bad() {
@@ -2102,10 +2196,10 @@ necessarily ready for every-day use. These features are often of "prototype
 quality" or "almost production ready", but may not be stable enough to be
 considered a full-fleged language feature.
 
-For this reason, rust recognizes a special crate-level attribute of the form:
+For this reason, Rust recognizes a special crate-level attribute of the form:
 
 ~~~~ {.ignore}
-#[feature(feature1, feature2, feature3)]
+#![feature(feature1, feature2, feature3)]
 ~~~~
 
 This directive informs the compiler that the feature list: `feature1`,
@@ -2113,7 +2207,7 @@ This directive informs the compiler that the feature list: `feature1`,
 crate-level, not at a module-level. Without this directive, all features are
 considered off, and using the features will result in a compiler error.
 
-The currently implemented features of the compiler are:
+The currently implemented features of the reference compiler are:
 
 * `macro_rules` - The definition of new macros. This does not encompass
                   macro-invocation, that is always enabled by default, this only
@@ -3884,7 +3978,7 @@ Rust provides several macros to log information. Here's a simple Rust program
 that demonstrates all four of them:
 
 ~~~~
-#[feature(phase)];
+#![feature(phase)]
 #[phase(syntax, link)] extern crate log;
 
 fn main() {
index 62e0fabdc053058d87a33df848c9f8894f2dbe78..713c41ddf7d8e2c810456e219d9e89ae99b54c16 100644 (file)
@@ -100,9 +100,9 @@ If you've fulfilled those prerequisites, something along these lines
 should work.
 
 ~~~~ {.notrust}
-$ curl -O http://static.rust-lang.org/dist/rust-0.9.tar.gz
-$ tar -xzf rust-0.9.tar.gz
-$ cd rust-0.9
+$ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz
+$ tar -xzf rust-nightly.tar.gz
+$ cd rust-nightly
 $ ./configure
 $ make && make install
 ~~~~
@@ -117,8 +117,8 @@ When complete, `make install` will place several programs into
 `/usr/local/bin`: `rustc`, the Rust compiler, and `rustdoc`, the
 API-documentation tool.
 
-[tarball]: http://static.rust-lang.org/dist/rust-0.9.tar.gz
-[win-exe]: http://static.rust-lang.org/dist/rust-0.9-install.exe
+[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
+[win-exe]: http://static.rust-lang.org/dist/rust-nightly-install.exe
 
 ## Compiling your first program
 
@@ -2107,7 +2107,7 @@ references, or types where the only contained references
 have the `'static` lifetime. (For more on named lifetimes and their uses,
 see the [references and lifetimes guide][lifetimes].)
 
-> ***Note:*** These two traits were referred to as 'kinds' in earlier
+> ***Note:*** These built-in traits were referred to as 'kinds' in earlier
 > iterations of the language, and often still are.
 
 Additionally, the `Drop` trait is used to define destructors. This
@@ -2600,8 +2600,6 @@ As you can see, your module hierarchy is now three modules deep: There is the cr
 function, and the module `farm`. The module `farm` also contains two functions and a third module `barn`,
 which contains a function `hay`.
 
-(In case you already stumbled over `extern crate`: It isn't directly related to a bare `mod`, we'll get to it later. )
-
 ## Paths and visibility
 
 We've now defined a nice module hierarchy. But how do we access the items in it from our `main` function?
@@ -2843,11 +2841,11 @@ use farm::cow;
 
 The path you give to `use` is per default global, meaning relative to the crate root,
 no matter how deep the module hierarchy is, or whether the module body it's written in
-is contained in its own file (remember: files are irrelevant).
+is contained in its own file. (Remember: files are irrelevant.)
 
-This is different to other languages, where you often only find a single import construct that combines the semantic
+This is different from other languages, where you often only find a single import construct that combines the semantic
 of `mod foo;` and `use`-statements, and which tend to work relative to the source file or use an absolute file path
-- Rubys `require` or C/C++'s `#include` come to mind.
+- Ruby's `require` or C/C++'s `#include` come to mind.
 
 However, it's also possible to import things relative to the module of the `use`-statement:
 Adding a `super::` in front of the path will start in the parent module,
@@ -3027,7 +3025,7 @@ The nested `barn` module is private, but the `pub use` allows users
 of the module `farm` to access a function from `barn` without needing
 to know that `barn` exists.
 
-In other words, you can use them to decouple an public api from their internal implementation.
+In other words, you can use it to decouple a public api from its internal implementation.
 
 ## Using libraries
 
@@ -3050,7 +3048,6 @@ fn main() {
 }
 ~~~
 
-Despite its name, `extern crate` is a distinct construct from regular `mod` declarations:
 A statement of the form `extern crate foo;` will cause `rustc` to search for the crate `foo`,
 and if it finds a matching binary it lets you use it from inside your crate.
 
index 3a99af3446c2e173da9d22e794d126cd46b9ee66..26bdf7d7fba6741840fd745db698366014c6de28 100644 (file)
                        ;; but the "else" or "{" should align with the beginning
                        ;; of the expression it's in.)
                        (looking-at "\\<else\\>\\|{")
-                       
+
                        (save-excursion
                          (rust-rewind-irrelevant)
                          ;; Point is now at the end of the previous ine
      ;; Special types
      (,(regexp-opt rust-special-types 'words) . font-lock-type-face)
 
-     ;; Attributes like `#[bar(baz)]`
-     (,(rust-re-grab (concat "#\\[" rust-re-ident "[^]]*\\]"))
+     ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]`
+     (,(rust-re-grab (concat "#\\!?[" rust-re-ident "[^]]*\\]"))
       1 font-lock-preprocessor-face)
 
      ;; Syntax extension invocations like `foo!`, highlight including the !
index b9b0aa55a863caee17deece1df8cb6cc7e8d65fd..7ffa35b94e49118d37f090d86f21a406ba292526 100644 (file)
     </context>
 
     <context id="attribute" style-ref="attribute" class="attribute">
-      <start extended="true">\#\[</start>
+      <start extended="true">\#!?\[</start>
       <end>\]</end>
       <include>
         <context ref="def:in-comment"/>
index 288085d8bae66e92067b56ad17da5a7a4af91b1e..7fc44ebad2955ed5143f18e9e5ec0dea3841a23d 100644 (file)
@@ -7,7 +7,7 @@
        <!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
        <!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
 ]>
-<language name="Rust" version="0.10-pre" kateversion="2.4" section="Sources" extensions="*.rs" mimetype="text/x-rust" priority="15">
+<language name="Rust" version="0.11-pre" kateversion="2.4" section="Sources" extensions="*.rs" mimetype="text/x-rust" priority="15">
 <highlighting>
        <list name="fn">
                <item> fn </item>
                        <RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
                        <RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/>
                        <Detect2Chars char="#" char1="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/>
+                       <Detect2Chars char="#" char1="!" char2="[" attribute="Attribute" context="Attribute" beginRegion="Attribute"/>
                        <RegExpr String="&rustIdent;::" attribute="Scope"/>
                        <RegExpr String="&rustIdent;!" attribute="Macro"/>
                        <RegExpr String="&apos;&rustIdent;(?!&apos;)" attribute="Lifetime"/>
index 2099d3c01c4331b27f7daddca4e3ea015b5260e3..17ab294a3f6d8eb23e52180dd071617d34a8ef3c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -15,7 +15,7 @@
 //! of individual objects while the arena itself is still alive. The benefit
 //! of an arena is very fast allocation; just a pointer bump.
 
-#![crate_id = "arena#0.10-pre"]
+#![crate_id = "arena#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
@@ -23,8 +23,6 @@
        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
        html_root_url = "http://static.rust-lang.org/doc/master")]
 #![allow(missing_doc)]
-#![feature(managed_boxes)]
-
 #![allow(visible_private_types)] // NOTE: remove after a stage0 snap
 
 extern crate collections;
@@ -301,7 +299,7 @@ fn test_arena_destructors() {
     for i in range(0u, 10) {
         // Arena allocate something with drop glue to make sure it
         // doesn't leak.
-        arena.alloc(|| @i);
+        arena.alloc(|| Rc::new(i));
         // Allocate something with funny size and alignment, to keep
         // things interesting.
         arena.alloc(|| [0u8, 1u8, 2u8]);
@@ -316,13 +314,13 @@ fn test_arena_destructors_fail() {
     for i in range(0u, 10) {
         // Arena allocate something with drop glue to make sure it
         // doesn't leak.
-        arena.alloc(|| { @i });
+        arena.alloc(|| { Rc::new(i) });
         // Allocate something with funny size and alignment, to keep
         // things interesting.
         arena.alloc(|| { [0u8, 1u8, 2u8] });
     }
     // Now, fail while allocating
-    arena.alloc::<@int>(|| {
+    arena.alloc::<Rc<int>>(|| {
         // Now fail.
         fail!();
     });
index de8d1c999bd3c36e43221655e44f8a07925e7dd8..84c440aa3a9f45f7a999c46514ddb2f364c5e8c9 100644 (file)
@@ -12,7 +12,7 @@
  * Collection types.
  */
 
-#![crate_id = "collections#0.10-pre"]
+#![crate_id = "collections#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index d44dfbef253780d591f50a4f86e1a1645f4d8e93..ddcd8cf46bb6c6008f61d767c1b4213a5f06aa91 100644 (file)
@@ -14,7 +14,7 @@
 
 */
 
-#![crate_id = "flate#0.10-pre"]
+#![crate_id = "flate#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index bf327c1bc2753ac39c595a717fca7394e442b261..267b0592d76809d20e2641d2d2c7bc2de5f44738 100644 (file)
@@ -39,7 +39,7 @@ fn main() {
 
 */
 
-#![crate_id = "fourcc#0.10-pre"]
+#![crate_id = "fourcc#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index e8a40ed66a1f981bbfa720fac071a2fa5a1c9ff4..dfb91a477cb7dba495e230d0f4d3131000a912aa 100644 (file)
@@ -76,7 +76,7 @@
 //! }
 //! ~~~
 
-#![crate_id = "getopts#0.10-pre"]
+#![crate_id = "getopts#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 7c2e5f7a5d9ada0114c277b07d4220adf2f761f3..5065fed01292fcbd6aeab70eaa1d8e875991c7bf 100644 (file)
@@ -23,7 +23,7 @@
  * `glob`/`fnmatch` functions.
  */
 
-#![crate_id = "glob#0.10-pre"]
+#![crate_id = "glob#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 00081c82f5e7047edc890b5f48db97040593bb19..5de8c637cf2034d392015fbfbc3f523cb979bcdd 100644 (file)
 //! pool.shutdown();
 //! ```
 
-#![crate_id = "green#0.10-pre"]
+#![crate_id = "green#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 3ed0d598dd8e0196669cba9b99264a05519e84bd..9f2f417080f9281a1246969ad9932349c3100774 100644 (file)
@@ -36,7 +36,7 @@ fn main() {
 
 */
 
-#![crate_id = "hexfloat#0.10-pre"]
+#![crate_id = "hexfloat#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 8013ebe6511072a23e015024272b24cd84fc58d2..eb481c8b217cf5e7b93d8fefbd12cc09b4545ea0 100644 (file)
@@ -105,7 +105,7 @@ fn main() {
 
 */
 
-#![crate_id = "log#0.10-pre"]
+#![crate_id = "log#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 06b51b563064c06d1875b04339240882fb17ab83..8afbbda71c27ea5ec399b26c6a602aef0d421f4f 100644 (file)
@@ -41,7 +41,7 @@
 //! }
 //! ```
 
-#![crate_id = "native#0.10-pre"]
+#![crate_id = "native#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index 453dd3c0834c25fec8a7226701c8705d6a8accaa..986ba9e9a5c14662ba21dd516515caae791b6f62 100644 (file)
@@ -10,7 +10,7 @@
 
 #![feature(macro_rules)]
 
-#![crate_id = "num#0.10-pre"]
+#![crate_id = "num#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 5cd53ca88a9d9ddefc59f4ed2bf906fb69e5c7cc..70dd0da3130ed298dfdcbe8b40e70a28b690b49b 100644 (file)
@@ -28,7 +28,7 @@
 /// Generate Normal Random
 /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
 /// College, Oxford
-pub struct Exp1(f64);
+pub struct Exp1(pub f64);
 
 // This could be done via `-rng.gen::<f64>().ln()` but that is slower.
 impl Rand for Exp1 {
index 7340d00929e3e7e722cd2fa52e6ca70cd40c4e37..2745ddd4ce785782e86246b50da43910b2025bd9 100644 (file)
@@ -27,7 +27,7 @@
 /// Generate Normal Random
 /// Samples*](http://www.doornik.com/research/ziggurat.pdf). Nuffield
 /// College, Oxford
-pub struct StandardNormal(f64);
+pub struct StandardNormal(pub f64);
 
 impl Rand for StandardNormal {
     fn rand<R:Rng>(rng: &mut R) -> StandardNormal {
index 25e680ae77d711b1bc94fc255afa1858f3731d4a..8623e627e5300e999fef9c358d7846c2fc62e5e5 100644 (file)
@@ -62,7 +62,7 @@
 ```
 */
 
-#![crate_id = "rand#0.10-pre"]
+#![crate_id = "rand#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
@@ -666,7 +666,7 @@ pub fn random<T: Rand>() -> T {
 /// let Open01(val) = random::<Open01<f32>>();
 /// println!("f32 from (0,1): {}", val);
 /// ```
-pub struct Open01<F>(F);
+pub struct Open01<F>(pub F);
 
 /// A wrapper for generating floating point numbers uniformly in the
 /// closed interval `[0,1]` (including both endpoints).
@@ -682,7 +682,7 @@ pub fn random<T: Rand>() -> T {
 /// let Closed01(val) = random::<Closed01<f32>>();
 /// println!("f32 from [0,1]: {}", val);
 /// ```
-pub struct Closed01<F>(F);
+pub struct Closed01<F>(pub F);
 
 #[cfg(test)]
 mod test {
index 83a17bd3231a2442285a5035f95036950934858f..c722beb43ae955c9e7ebdc487638dad5cf422cf2 100644 (file)
@@ -8,44 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub static rc_base_field_refcnt: uint = 0u;
-
-pub static task_field_refcnt: uint = 0u;
-
-pub static task_field_stk: uint = 2u;
-
-pub static task_field_runtime_sp: uint = 3u;
-
-pub static task_field_rust_sp: uint = 4u;
-
-pub static task_field_gc_alloc_chain: uint = 5u;
-
-pub static task_field_dom: uint = 6u;
-
-pub static n_visible_task_fields: uint = 7u;
-
-pub static dom_field_interrupt_flag: uint = 1u;
-
-pub static frame_glue_fns_field_mark: uint = 0u;
-
-pub static frame_glue_fns_field_drop: uint = 1u;
-
-pub static frame_glue_fns_field_reloc: uint = 2u;
-
 pub static box_field_refcnt: uint = 0u;
 pub static box_field_tydesc: uint = 1u;
-pub static box_field_prev: uint = 2u;
-pub static box_field_next: uint = 3u;
 pub static box_field_body: uint = 4u;
 
-pub static general_code_alignment: uint = 16u;
-
-pub static tydesc_field_size: uint = 0u;
-pub static tydesc_field_align: uint = 1u;
-pub static tydesc_field_drop_glue: uint = 2u;
 pub static tydesc_field_visit_glue: uint = 3u;
-pub static tydesc_field_name_offset: uint = 4u;
-pub static n_tydesc_fields: uint = 5u;
 
 // The two halves of a closure: code and environment.
 pub static fn_field_code: uint = 0u;
@@ -64,5 +31,3 @@
 
 pub static slice_elt_base: uint = 0u;
 pub static slice_elt_len: uint = 1u;
-
-pub static abi_version: uint = 1u;
index d6173176c160b8f604a42cd40711c23a447d3621..6de7bb59b6180ea82ee96d0bf6881d7154a47b9f 100644 (file)
@@ -87,29 +87,6 @@ pub fn open(sess: &'a Session, dst: Path) -> Archive<'a> {
         Archive { sess: sess, dst: dst }
     }
 
-    /// Read a file in the archive
-    pub fn read(&self, file: &str) -> Vec<u8> {
-        // Apparently if "ar p" is used on windows, it generates a corrupt file
-        // which has bad headers and LLVM will immediately choke on it
-        if cfg!(windows) {
-            let loc = TempDir::new("rsar").unwrap();
-            let archive = os::make_absolute(&self.dst);
-            run_ar(self.sess, "x", Some(loc.path()), [&archive,
-                                                      &Path::new(file)]);
-            let result: Vec<u8> =
-                fs::File::open(&loc.path().join(file)).read_to_end()
-                                                      .unwrap()
-                                                      .move_iter()
-                                                      .collect();
-            result
-        } else {
-            run_ar(self.sess,
-                   "p",
-                   None,
-                   [&self.dst, &Path::new(file)]).output.move_iter().collect()
-        }
-    }
-
     /// Adds all of the contents of a native library to this archive. This will
     /// search in the relevant locations for a library named `name`.
     pub fn add_native_library(&mut self, name: &str) -> io::IoResult<()> {
index f198a41af655754fa3c8e5fe67412a04423f3658..e9292f54a4b266f6c7c27152f130d44596087416 100644 (file)
@@ -687,16 +687,6 @@ pub fn mangle_exported_name(ccx: &CrateContext, path: PathElems,
     exported_name(path, hash, ccx.link_meta.crateid.version_or_default())
 }
 
-pub fn mangle_internal_name_by_type_only(ccx: &CrateContext,
-                                         t: ty::t,
-                                         name: &str) -> ~str {
-    let s = ppaux::ty_to_short_str(ccx.tcx(), t);
-    let path = [PathName(token::intern(name)),
-                PathName(token::intern(s))];
-    let hash = get_symbol_hash(ccx, t);
-    mangle(ast_map::Values(path.iter()), Some(hash.as_slice()), None)
-}
-
 pub fn mangle_internal_name_by_type_and_seq(ccx: &CrateContext,
                                             t: ty::t,
                                             name: &str) -> ~str {
index b4861d196e0299d55f470ae1a2b6f8c01dbb2e0f..cfbe772a165db032ed4596f701f5511e24300054 100644 (file)
@@ -90,7 +90,7 @@ fn fold_foreign_mod(cx: &mut Context, nm: &ast::ForeignMod) -> ast::ForeignMod {
         filter_view_item(cx, a).map(|x| cx.fold_view_item(x))
     }).collect();
     ast::ForeignMod {
-        abis: nm.abis,
+        abi: nm.abi,
         view_items: filtered_view_items,
         items: filtered_items
     }
index 9182f19130cb174f2266661ff5b5e42d91e5b812..895abe174704cfe243e677a410bd060a1d532653 100644 (file)
@@ -22,7 +22,7 @@
 use syntax::parse::token;
 use syntax::util::small_vector::SmallVector;
 
-pub static VERSION: &'static str = "0.10-pre";
+pub static VERSION: &'static str = "0.11-pre";
 
 pub fn maybe_inject_crates_ref(sess: &Session, krate: ast::Crate)
                                -> ast::Crate {
index 3aac4f6b72e08fbbae4bb4ecf152306576d86884..cf653f816ac7b7493f2e9bb10704bad5b5d64a84 100644 (file)
@@ -18,7 +18,7 @@
 
 */
 
-#![crate_id = "rustc#0.10-pre"]
+#![crate_id = "rustc#0.11-pre"]
 #![comment = "The Rust compiler"]
 #![license = "MIT/ASL2"]
 #![crate_type = "dylib"]
index d9e1b779e96517793a0d1e1c04e1cd7d86b529e8..9cfe064ad986f9ee63225cf1fd7e73e2f6f0b1bc 100644 (file)
@@ -10,6 +10,7 @@
 
 #![allow(non_uppercase_pattern_statics)]
 #![allow(non_camel_case_types)]
+#![allow(dead_code)]
 
 use std::c_str::ToCStr;
 use std::cell::RefCell;
@@ -1437,8 +1438,6 @@ pub fn LLVMIsSectionIteratorAtEnd(ObjFile: ObjectFileRef,
                                           -> Bool;
         /** Moves the section iterator to point to the next section. */
         pub fn LLVMMoveToNextSection(SI: SectionIteratorRef);
-        /** Returns the current section name. */
-        pub fn LLVMGetSectionName(SI: SectionIteratorRef) -> *c_char;
         /** Returns the current section size. */
         pub fn LLVMGetSectionSize(SI: SectionIteratorRef) -> c_ulonglong;
         /** Returns the current section contents as a string buffer. */
@@ -1783,6 +1782,9 @@ pub fn LLVMRustArchiveReadSection(AR: ArchiveRef, name: *c_char,
 
         pub fn LLVMRustSetDLLExportStorageClass(V: ValueRef);
         pub fn LLVMVersionMinor() -> c_int;
+
+        pub fn LLVMRustGetSectionName(SI: SectionIteratorRef,
+                                      data: *mut *c_char) -> c_int;
     }
 }
 
@@ -1911,42 +1913,6 @@ pub fn mk_target_data(string_rep: &str) -> TargetData {
     }
 }
 
-/* Memory-managed interface to pass managers. */
-
-pub struct pass_manager_res {
-    pub pm: PassManagerRef,
-}
-
-impl Drop for pass_manager_res {
-    fn drop(&mut self) {
-        unsafe {
-            llvm::LLVMDisposePassManager(self.pm);
-        }
-    }
-}
-
-pub fn pass_manager_res(pm: PassManagerRef) -> pass_manager_res {
-    pass_manager_res {
-        pm: pm
-    }
-}
-
-pub struct PassManager {
-    pub llpm: PassManagerRef,
-    dtor: @pass_manager_res
-}
-
-pub fn mk_pass_manager() -> PassManager {
-    unsafe {
-        let llpm = llvm::LLVMCreatePassManager();
-
-        PassManager {
-            llpm: llpm,
-            dtor: @pass_manager_res(llpm)
-        }
-    }
-}
-
 /* Memory-managed interface to object files. */
 
 pub struct ObjectFile {
index 09d3b36321fa9a91b5fcc0afa383758bf8a3f345..264829b18a309453d318327537b153883b2509aa 100644 (file)
@@ -73,8 +73,6 @@
 pub static tag_crate_hash: uint = 0x1a;
 pub static tag_crate_crateid: uint = 0x1b;
 
-pub static tag_parent_item: uint = 0x1c;
-
 pub static tag_crate_dep_crateid: uint = 0x1d;
 pub static tag_crate_dep_hash: uint = 0x1e;
 
 pub static tag_path_elem_mod: uint = 0x26;
 pub static tag_path_elem_name: uint = 0x27;
 pub static tag_item_field: uint = 0x28;
-pub static tag_struct_mut: uint = 0x29;
 
 pub static tag_item_variances: uint = 0x2a;
-pub static tag_mod_impl_trait: uint = 0x2b;
 /*
   trait items contain tag_item_trait_method elements,
   impl items contain tag_item_impl_method elements, and classes
@@ -108,7 +104,6 @@ impl items contain tag_item_impl_method elements, and classes
  */
 pub static tag_item_impl_method: uint = 0x2c;
 pub static tag_item_trait_method_explicit_self: uint = 0x2d;
-pub static tag_item_trait_method_self_ty_region: uint = 0x2e;
 
 
 // Reexports are found within module tags. Each reexport contains def_ids
@@ -173,12 +168,8 @@ pub fn from_uint(value : uint) -> Option<astencode_tag> {
 pub static tag_lang_items_item_node_id: uint = 0x4b;
 
 pub static tag_item_unnamed_field: uint = 0x4c;
-pub static tag_items_data_item_struct_ctor: uint = 0x4d;
 pub static tag_items_data_item_visibility: uint = 0x4e;
 
-pub static tag_link_args: uint = 0x4f;
-pub static tag_link_args_arg: uint = 0x50;
-
 pub static tag_item_method_tps: uint = 0x51;
 pub static tag_item_method_fty: uint = 0x52;
 
index 36febfc1a09ca452ecda585d9a62f209d1232f72..d957850264681d5c00f730fc221d0124ac4359c2 100644 (file)
@@ -187,7 +187,7 @@ fn extract_crate_info(e: &Env, i: &ast::ViewItem) -> Option<CrateInfo> {
 fn visit_item(e: &Env, i: &ast::Item) {
     match i.node {
         ast::ItemForeignMod(ref fm) => {
-            if fm.abis.is_rust() || fm.abis.is_intrinsic() {
+            if fm.abi == abi::Rust || fm.abi == abi::RustIntrinsic {
                 return;
             }
 
index d840ca329387d51dc8bc97ea71d3ebb0b58ad46c..977db296af96b8eef3f2255d58a607354aa8f2b0 100644 (file)
@@ -37,12 +37,6 @@ pub fn get_symbol(cstore: &cstore::CStore, def: ast::DefId) -> ~str {
     return decoder::get_symbol(cdata, def.node);
 }
 
-pub fn get_type_param_count(cstore: &cstore::CStore, def: ast::DefId)
-                         -> uint {
-    let cdata = cstore.get_crate_data(def.krate).data();
-    return decoder::get_type_param_count(cdata, def.node);
-}
-
 /// Iterates over all the language items in the given crate.
 pub fn each_lang_item(cstore: &cstore::CStore,
                       cnum: ast::CrateNum,
@@ -244,21 +238,6 @@ pub fn get_impl_vtables(tcx: &ty::ctxt,
     decoder::get_impl_vtables(cdata, def.node, tcx)
 }
 
-pub fn get_impl_method(cstore: &cstore::CStore,
-                       def: ast::DefId,
-                       mname: ast::Ident)
-                    -> Option<ast::DefId> {
-    let cdata = cstore.get_crate_data(def.krate);
-    decoder::get_impl_method(cstore.intr.clone(), cdata, def.node, mname)
-}
-
-pub fn get_item_visibility(cstore: &cstore::CStore,
-                           def_id: ast::DefId)
-                        -> ast::Visibility {
-    let cdata = cstore.get_crate_data(def_id.krate);
-    decoder::get_item_visibility(cdata, def_id.node)
-}
-
 pub fn get_native_libraries(cstore: &cstore::CStore,
                             crate_num: ast::CrateNum)
                                 -> Vec<(cstore::NativeLibaryKind, ~str)> {
@@ -311,3 +290,11 @@ pub fn get_exported_macros(cstore: &cstore::CStore,
     let cdata = cstore.get_crate_data(crate_num);
     decoder::get_exported_macros(cdata)
 }
+
+pub fn get_tuple_struct_definition_if_ctor(cstore: &cstore::CStore,
+                                           def_id: ast::DefId)
+    -> Option<ast::DefId>
+{
+    let cdata = cstore.get_crate_data(def_id.krate);
+    decoder::get_tuple_struct_definition_if_ctor(cdata, def_id.node)
+}
index 62fcc4c617e619e9eb01f8385a94928f89825810..e3a3239bdb5b852d11accd3aa22dd4c9db4610fa 100644 (file)
@@ -23,7 +23,6 @@
 use collections::HashMap;
 use syntax::ast;
 use syntax::parse::token::IdentInterner;
-use syntax::crateid::CrateId;
 
 // A map from external crate numbers (as decoded from some crate file) to
 // local crate numbers (as generated during this session). Each external
@@ -98,19 +97,10 @@ pub fn get_crate_hash(&self, cnum: ast::CrateNum) -> Svh {
         decoder::get_crate_hash(cdata.data())
     }
 
-    pub fn get_crate_id(&self, cnum: ast::CrateNum) -> CrateId {
-        let cdata = self.get_crate_data(cnum);
-        decoder::get_crate_id(cdata.data())
-    }
-
     pub fn set_crate_data(&self, cnum: ast::CrateNum, data: @crate_metadata) {
         self.metas.borrow_mut().insert(cnum, data);
     }
 
-    pub fn have_crate_data(&self, cnum: ast::CrateNum) -> bool {
-        self.metas.borrow().contains_key(&cnum)
-    }
-
     pub fn iter_crate_data(&self, i: |ast::CrateNum, @crate_metadata|) {
         for (&k, &v) in self.metas.borrow().iter() {
             i(k, v);
index 94941913a8b8831a1a0a8b6442768c902165c38b..556f0a38b03544a6049ff9aec2d0cea3e7a65fdc 100644 (file)
@@ -279,13 +279,6 @@ fn item_region_param_defs(item_doc: ebml::Doc, cdata: Cmd)
     Rc::new(v)
 }
 
-fn item_ty_param_count(item: ebml::Doc) -> uint {
-    let mut n = 0u;
-    reader::tagged_docs(item, tag_items_data_item_ty_param_bounds,
-                      |_p| { n += 1u; true } );
-    n
-}
-
 fn enum_variant_ids(item: ebml::Doc, cdata: Cmd) -> Vec<ast::DefId> {
     let mut ids: Vec<ast::DefId> = Vec::new();
     let v = tag_items_data_item_variant;
@@ -420,10 +413,6 @@ pub fn get_type(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
     }
 }
 
-pub fn get_type_param_count(data: &[u8], id: ast::NodeId) -> uint {
-    item_ty_param_count(lookup_item(id, data))
-}
-
 pub fn get_impl_trait(cdata: Cmd,
                       id: ast::NodeId,
                       tcx: &ty::ctxt) -> Option<@ty::TraitRef>
@@ -449,20 +438,6 @@ pub fn get_impl_vtables(cdata: Cmd,
 }
 
 
-pub fn get_impl_method(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId,
-                       name: ast::Ident) -> Option<ast::DefId> {
-    let items = reader::get_doc(reader::Doc(cdata.data()), tag_items);
-    let mut found = None;
-    reader::tagged_docs(find_item(id, items), tag_item_impl_method, |mid| {
-        let m_did = reader::with_doc_data(mid, parse_def_id);
-        if item_name(&*intr, find_item(m_did.node, items)) == name {
-            found = Some(translate_def_id(cdata, m_did));
-        }
-        true
-    });
-    found
-}
-
 pub fn get_symbol(data: &[u8], id: ast::NodeId) -> ~str {
     return item_symbol(lookup_item(id, data));
 }
@@ -475,14 +450,6 @@ pub enum DefLike {
     DlField
 }
 
-pub fn def_like_to_def(def_like: DefLike) -> ast::Def {
-    match def_like {
-        DlDef(def) => return def,
-        DlImpl(..) => fail!("found impl in def_like_to_def"),
-        DlField => fail!("found field in def_like_to_def")
-    }
-}
-
 /// Iterates over the language items in the given crate.
 pub fn each_lang_item(cdata: Cmd, f: |ast::NodeId, uint| -> bool) -> bool {
     let root = reader::Doc(cdata.data());
@@ -962,23 +929,26 @@ pub fn get_static_methods_if_impl(intr: Rc<IdentInterner>,
 /// If node_id is the constructor of a tuple struct, retrieve the NodeId of
 /// the actual type definition, otherwise, return None
 pub fn get_tuple_struct_definition_if_ctor(cdata: Cmd,
-                                           node_id: ast::NodeId) -> Option<ast::NodeId> {
+                                           node_id: ast::NodeId)
+    -> Option<ast::DefId>
+{
     let item = lookup_item(node_id, cdata.data());
     let mut ret = None;
     reader::tagged_docs(item, tag_items_data_item_is_tuple_struct_ctor, |_| {
         ret = Some(item_reqd_and_translated_parent_item(cdata.cnum, item));
         false
     });
-    ret.map(|x| x.node)
+    ret
 }
 
 pub fn get_item_attrs(cdata: Cmd,
-                      node_id: ast::NodeId,
+                      orig_node_id: ast::NodeId,
                       f: |Vec<@ast::MetaItem> |) {
     // The attributes for a tuple struct are attached to the definition, not the ctor;
     // we assume that someone passing in a tuple struct ctor is actually wanting to
     // look at the definition
-    let node_id = get_tuple_struct_definition_if_ctor(cdata, node_id).unwrap_or(node_id);
+    let node_id = get_tuple_struct_definition_if_ctor(cdata, orig_node_id);
+    let node_id = node_id.map(|x| x.node).unwrap_or(orig_node_id);
     let item = lookup_item(node_id, cdata.data());
     reader::tagged_docs(item, tag_attributes, |attributes| {
         reader::tagged_docs(attributes, tag_attribute, |attribute| {
@@ -1030,11 +1000,6 @@ pub fn get_struct_fields(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId)
     result
 }
 
-pub fn get_item_visibility(cdata: Cmd, id: ast::NodeId)
-                        -> ast::Visibility {
-    item_visibility(lookup_item(id, cdata.data()))
-}
-
 fn get_meta_items(md: ebml::Doc) -> Vec<@ast::MetaItem> {
     let mut items: Vec<@ast::MetaItem> = Vec::new();
     reader::tagged_docs(md, tag_meta_item_word, |meta_item_doc| {
@@ -1103,7 +1068,7 @@ fn list_crate_attributes(md: ebml::Doc, hash: &Svh,
 }
 
 pub fn get_crate_attributes(data: &[u8]) -> Vec<ast::Attribute> {
-    return get_attributes(reader::Doc(data));
+    get_attributes(reader::Doc(data))
 }
 
 #[deriving(Clone)]
index 1da698beb389633b28af45016dba0b8347bbeb37..ec6bb7de380f88fc6a5e9e9602cbe934f38d9980 100644 (file)
@@ -33,7 +33,7 @@
 use std::io::MemWriter;
 use std::str;
 use collections::HashMap;
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::ast::*;
 use syntax::ast;
 use syntax::ast_map::{PathElem, PathElems};
@@ -1217,7 +1217,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
                                 nitem: &ForeignItem,
                                 index: @RefCell<Vec<entry<i64>> >,
                                 path: PathElems,
-                                abi: AbiSet) {
+                                abi: abi::Abi) {
     index.borrow_mut().push(entry {
         val: nitem.id as i64,
         pos: ebml_w.writer.tell().unwrap(),
@@ -1231,7 +1231,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
         encode_bounds_and_type(ebml_w, ecx,
                                &lookup_item_type(ecx.tcx,local_def(nitem.id)));
         encode_name(ebml_w, nitem.ident.name);
-        if abi.is_intrinsic() {
+        if abi == abi::RustIntrinsic {
             (ecx.encode_inlined_item)(ecx, ebml_w, IIForeignRef(nitem));
         } else {
             encode_symbol(ecx, ebml_w, nitem.id);
@@ -1279,11 +1279,11 @@ fn my_visit_foreign_item(ni: &ForeignItem,
     let mut ebml_w = unsafe {
         ebml_w.unsafe_clone()
     };
-    let abis = ecx.tcx.map.get_foreign_abis(ni.id);
+    let abi = ecx.tcx.map.get_foreign_abi(ni.id);
     ecx.tcx.map.with_path(ni.id, |path| {
         encode_info_for_foreign_item(ecx, &mut ebml_w,
                                      ni, index,
-                                     path, abis);
+                                     path, abi);
     });
 }
 
index 468eac4d2694ce5220dee2a0b53a7a9469feac6d..b83f42da0a05681129522e205728ef45f60941dd 100644 (file)
@@ -84,12 +84,6 @@ pub fn get_target_lib_path(&self) -> Path {
         make_target_lib_path(self.sysroot, self.target_triple)
     }
 
-    pub fn get_target_lib_file_path(&self, file: &Path) -> Path {
-        let mut p = self.get_target_lib_path();
-        p.push(file);
-        p
-    }
-
     pub fn search(&self, pick: pick) {
         self.for_each_lib_search_path(|lib_search_path| {
             debug!("searching {}", lib_search_path.display());
index 8a3d6567c77a1b52c66475890265d87cd42ef94f..4dd892fd703452dc87786feaf3177b00fddc87e4 100644 (file)
 use std::cmp;
 use std::io;
 use std::os::consts::{macos, freebsd, linux, android, win32};
+use std::ptr;
 use std::rc::Rc;
-use std::str;
 use std::slice;
+use std::str;
 
 use collections::{HashMap, HashSet};
 use flate;
@@ -439,8 +440,9 @@ fn get_metadata_section_imp(os: Os, filename: &Path) -> Result<MetadataBlob, ~st
         };
         let si = mk_section_iter(of.llof);
         while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False {
-            let name_buf = llvm::LLVMGetSectionName(si.llsi);
-            let name = str::raw::from_c_str(name_buf);
+            let mut name_buf = ptr::null();
+            let name_len = llvm::LLVMRustGetSectionName(si.llsi, &mut name_buf);
+            let name = str::raw::from_buf_len(name_buf as *u8, name_len as uint);
             debug!("get_metadata_section: name {}", name);
             if read_meta_section_name(os) == name {
                 let cbuf = llvm::LLVMGetSectionContents(si.llsi);
index 7ff36f13b75b95993b6b0603f6918e156fb7132a..409957b8625d531e9b8ab080d22f3c34fcd88823 100644 (file)
@@ -20,7 +20,6 @@
 
 use std::str;
 use std::uint;
-use syntax::abi::AbiSet;
 use syntax::abi;
 use syntax::ast;
 use syntax::ast::*;
@@ -460,18 +459,12 @@ fn parse_purity(c: char) -> Purity {
     }
 }
 
-fn parse_abi_set(st: &mut PState) -> AbiSet {
+fn parse_abi_set(st: &mut PState) -> abi::Abi {
     assert_eq!(next(st), '[');
-    let mut abis = AbiSet::empty();
-    while peek(st) != ']' {
-         scan(st, |c| c == ',', |bytes| {
-                 let abi_str = str::from_utf8(bytes).unwrap().to_owned();
-                 let abi = abi::lookup(abi_str).expect(abi_str);
-                 abis.add(abi);
-              });
-    }
-    assert_eq!(next(st), ']');
-    return abis;
+    scan(st, |c| c == ']', |bytes| {
+        let abi_str = str::from_utf8(bytes).unwrap().to_owned();
+        abi::lookup(abi_str).expect(abi_str)
+    })
 }
 
 fn parse_onceness(c: char) -> ast::Onceness {
@@ -505,7 +498,7 @@ fn parse_bare_fn_ty(st: &mut PState, conv: conv_did) -> ty::BareFnTy {
     let sig = parse_sig(st, |x,y| conv(x,y));
     ty::BareFnTy {
         purity: purity,
-        abis: abi,
+        abi: abi,
         sig: sig
     }
 }
index 7e8480e4311a20b68fd6c88c0373afccfad4fb5a..4053db72a28cd31ffafec5c29684351538f6ad66 100644 (file)
@@ -23,7 +23,7 @@
 use middle::ty::param_ty;
 use middle::ty;
 
-use syntax::abi::AbiSet;
+use syntax::abi::Abi;
 use syntax::ast;
 use syntax::ast::*;
 use syntax::diagnostic::SpanHandler;
@@ -341,12 +341,9 @@ fn enc_purity(w: &mut MemWriter, p: Purity) {
     }
 }
 
-fn enc_abi_set(w: &mut MemWriter, abis: AbiSet) {
+fn enc_abi(w: &mut MemWriter, abi: Abi) {
     mywrite!(w, "[");
-    abis.each(|abi| {
-        mywrite!(w, "{},", abi.name());
-        true
-    });
+    mywrite!(w, "{}", abi.name());
     mywrite!(w, "]")
 }
 
@@ -359,7 +356,7 @@ fn enc_onceness(w: &mut MemWriter, o: Onceness) {
 
 pub fn enc_bare_fn_ty(w: &mut MemWriter, cx: &ctxt, ft: &ty::BareFnTy) {
     enc_purity(w, ft.purity);
-    enc_abi_set(w, ft.abis);
+    enc_abi(w, ft.abi);
     enc_fn_sig(w, cx, &ft.sig);
 }
 
index 383739a1b0320db53ecbcc7545daaf1bf8a0ebd2..e6f6a87be4fdcc41db014e2a242ea4bf3adb5840 100644 (file)
@@ -111,13 +111,6 @@ pub fn encode_inlined_item(ecx: &e::EncodeContext,
            ebml_w.writer.tell());
 }
 
-pub fn encode_exported_macro(ebml_w: &mut Encoder, i: &ast::Item) {
-    match i.node {
-        ast::ItemMac(..) => encode_ast(ebml_w, ast::IIItem(@i.clone())),
-        _ => fail!("expected a macro")
-    }
-}
-
 pub fn decode_inlined_item(cdata: @cstore::crate_metadata,
                            tcx: &ty::ctxt,
                            maps: &Maps,
@@ -173,13 +166,6 @@ pub fn decode_inlined_item(cdata: @cstore::crate_metadata,
     }
 }
 
-pub fn decode_exported_macro(par_doc: ebml::Doc) -> @ast::Item {
-    match decode_ast(par_doc) {
-        ast::IIItem(item) => item,
-        _ => fail!("expected item")
-    }
-}
-
 // ______________________________________________________________________
 // Enumerating the IDs which appear in an AST
 
index b8b05128e4c2c3b87246ae98f7385b4bc9f4f465..6f4f2f6345eb48fa0fe161caa0bfab9d08a8accf 100644 (file)
@@ -326,6 +326,7 @@ pub struct RestrictionSet {
     bits: u32
 }
 
+#[allow(dead_code)] // potentially useful
 pub static RESTR_EMPTY: RestrictionSet  = RestrictionSet {bits: 0b0000};
 pub static RESTR_MUTATE: RestrictionSet = RestrictionSet {bits: 0b0001};
 pub static RESTR_FREEZE: RestrictionSet = RestrictionSet {bits: 0b0010};
@@ -334,10 +335,6 @@ impl RestrictionSet {
     pub fn intersects(&self, restr: RestrictionSet) -> bool {
         (self.bits & restr.bits) != 0
     }
-
-    pub fn contains_all(&self, restr: RestrictionSet) -> bool {
-        (self.bits & restr.bits) == restr.bits
-    }
 }
 
 impl BitOr<RestrictionSet,RestrictionSet> for RestrictionSet {
@@ -862,17 +859,6 @@ pub fn loan_path_to_str(&self, loan_path: &LoanPath) -> ~str {
     pub fn cmt_to_str(&self, cmt: mc::cmt) -> ~str {
         self.mc().cmt_to_str(cmt)
     }
-
-    pub fn mut_to_str(&self, mutbl: ast::Mutability) -> ~str {
-        self.mc().mut_to_str(mutbl)
-    }
-
-    pub fn mut_to_keyword(&self, mutbl: ast::Mutability) -> &'static str {
-        match mutbl {
-            ast::MutImmutable => "",
-            ast::MutMutable => "mut",
-        }
-    }
 }
 
 impl DataFlowOperator for LoanDataFlowOperator {
index 9c2dcd74351e3100b08699939b57cfb360b1e91d..97ea996bb7e458e3dd53aecd37b2c375e4b38118 100644 (file)
@@ -15,6 +15,8 @@
 
 */
 
+#![allow(dead_code)] // still a WIP, #6298
+
 use middle::graph;
 use middle::ty;
 use middle::typeck;
index 7fadfff21d119bb95223e5024c66d85f95fffa51..bd45956fbb2ac9610ba4a0fc340af12da3324498 100644 (file)
@@ -521,11 +521,3 @@ pub fn compare_const_vals(a: &const_val, b: &const_val) -> Option<int> {
 pub fn compare_lit_exprs(tcx: &ty::ctxt, a: &Expr, b: &Expr) -> Option<int> {
     compare_const_vals(&eval_const_expr(tcx, a), &eval_const_expr(tcx, b))
 }
-
-pub fn lit_expr_eq(tcx: &ty::ctxt, a: &Expr, b: &Expr) -> Option<bool> {
-    compare_lit_exprs(tcx, a, b).map(|val| val == 0)
-}
-
-pub fn lit_eq(a: &Lit, b: &Lit) -> Option<bool> {
-    compare_const_vals(&lit_to_const(a), &lit_to_const(b)).map(|val| val == 0)
-}
index 2adc3e82576f2b185882cac73274b514d80bf788..92d359887b98f00aa6c48789e280580d1688cb38 100644 (file)
@@ -246,31 +246,6 @@ pub fn each_bit_on_entry_frozen(&self,
         self.each_bit(on_entry, f)
     }
 
-    pub fn each_bit_on_entry(&mut self,
-                             id: ast::NodeId,
-                             f: |uint| -> bool)
-                             -> bool {
-        //! Iterates through each bit that is set on entry to `id`.
-        //! Only useful after `propagate()` has been called.
-
-        let (start, end) = self.compute_id_range(id);
-        let on_entry = self.on_entry.slice(start, end);
-        debug!("each_bit_on_entry(id={:?}, on_entry={})",
-               id, bits_to_str(on_entry));
-        self.each_bit(on_entry, f)
-    }
-
-    pub fn each_gen_bit(&mut self, id: ast::NodeId, f: |uint| -> bool)
-                        -> bool {
-        //! Iterates through each bit in the gen set for `id`.
-
-        let (start, end) = self.compute_id_range(id);
-        let gens = self.gens.slice(start, end);
-        debug!("each_gen_bit(id={:?}, gens={})",
-               id, bits_to_str(gens));
-        self.each_bit(gens, f)
-    }
-
     pub fn each_gen_bit_frozen(&self, id: ast::NodeId, f: |uint| -> bool)
                                -> bool {
         //! Iterates through each bit in the gen set for `id`.
index d8851fa46f8bae96ad4bfdcff05e5746ae771b56..d6adb19419b517b0f1375ebdca2e8a522b00fa78 100644 (file)
@@ -145,7 +145,3 @@ pub fn get_freevars(tcx: &ty::ctxt, fid: ast::NodeId) -> freevar_info {
         Some(&d) => return d
     }
 }
-
-pub fn has_freevars(tcx: &ty::ctxt, fid: ast::NodeId) -> bool {
-    !get_freevars(tcx, fid).is_empty()
-}
index fd27cabaf7fbab23746b66b8b5b07e44a79a4cb0..2705f9bf9bf4dfc0e4de7cd98409a7076f981a41 100644 (file)
@@ -34,6 +34,8 @@
 
 */
 
+#![allow(dead_code)] // still WIP
+
 use std::uint;
 
 pub struct Graph<N,E> {
@@ -54,11 +56,11 @@ pub struct Edge<E> {
 }
 
 #[deriving(Eq)]
-pub struct NodeIndex(uint);
+pub struct NodeIndex(pub uint);
 pub static InvalidNodeIndex: NodeIndex = NodeIndex(uint::MAX);
 
 #[deriving(Eq)]
-pub struct EdgeIndex(uint);
+pub struct EdgeIndex(pub uint);
 pub static InvalidEdgeIndex: EdgeIndex = EdgeIndex(uint::MAX);
 
 // Use a private field here to guarantee no more instances are created:
index fd53c2e544d2c6d1f7f9f10b04e011321ee727df..a667e81f349fe63fb9804e88825cfca06d2c1c22 100644 (file)
@@ -450,17 +450,6 @@ fn check_copy(cx: &Context, ty: ty::t, sp: Span, reason: &str) {
     }
 }
 
-pub fn check_send(cx: &Context, ty: ty::t, sp: Span) -> bool {
-    if !ty::type_is_sendable(cx.tcx, ty) {
-        cx.tcx.sess.span_err(
-            sp, format!("value has non-sendable type `{}`",
-                     ty_to_str(cx.tcx, ty)));
-        false
-    } else {
-        true
-    }
-}
-
 pub fn check_static(tcx: &ty::ctxt, ty: ty::t, sp: Span) -> bool {
     if !ty::type_is_static(tcx, ty) {
         match ty::get(ty).sty {
index 86db6b6a46373a22430a8e0fcc3b9e3df4282be4..7fca0e56aa21f67aa4cd802579459a3597c2baed 100644 (file)
@@ -96,6 +96,7 @@ pub fn to_builtin_kind(&self, id: ast::DefId) -> Option<ty::BuiltinBound> {
     }
 
     $(
+        #[allow(dead_code)]
         pub fn $method(&self) -> Option<ast::DefId> {
             *self.items.get($variant as uint)
         }
index 97f5cca1cabb5d025465dc891db880dc12594f08..da74d0c7729e6f1727076a835132c58db21efcc6 100644 (file)
@@ -59,6 +59,7 @@
 use std::u64;
 use std::u8;
 use collections::SmallIntMap;
+use syntax::abi;
 use syntax::ast_map;
 use syntax::ast_util::IdVisitingOperation;
 use syntax::attr::{AttrMetaMethods, AttributeMethods};
@@ -892,7 +893,7 @@ fn check_foreign_fn(cx: &Context, decl: &ast::FnDecl) {
     }
 
     match it.node {
-      ast::ItemForeignMod(ref nmod) if !nmod.abis.is_intrinsic() => {
+      ast::ItemForeignMod(ref nmod) if nmod.abi != abi::RustIntrinsic => {
         for ni in nmod.items.iter() {
             match ni.node {
                 ast::ForeignItemFn(decl, _) => check_foreign_fn(cx, decl),
index 3604499add6936040caf4a8ddc109b4b937e42e0..e376e66ca6f90c8ba76612db0c44e5d14e8c5aab 100644 (file)
@@ -64,7 +64,7 @@
 
 use middle::ty;
 use middle::typeck;
-use util::ppaux::{ty_to_str, region_ptr_to_str, Repr};
+use util::ppaux::{ty_to_str, Repr};
 
 use syntax::ast::{MutImmutable, MutMutable};
 use syntax::ast;
@@ -674,20 +674,6 @@ pub fn cat_rvalue(&mut self,
         }
     }
 
-    /// inherited mutability: used in cases where the mutability of a
-    /// component is inherited from the base it is a part of. For
-    /// example, a record field is mutable if it is declared mutable
-    /// or if the container is mutable.
-    pub fn inherited_mutability(&mut self,
-                                base_m: MutabilityCategory,
-                                interior_m: ast::Mutability)
-                                -> MutabilityCategory {
-        match interior_m {
-            MutImmutable => base_m.inherit(),
-            MutMutable => McDeclared
-        }
-    }
-
     pub fn cat_field<N:ast_node>(&mut self,
                                  node: &N,
                                  base_cmt: cmt,
@@ -1114,13 +1100,6 @@ pub fn cat_pattern(&mut self,
         Ok(())
     }
 
-    pub fn mut_to_str(&mut self, mutbl: ast::Mutability) -> ~str {
-        match mutbl {
-          MutMutable => ~"mutable",
-          MutImmutable => ~"immutable"
-        }
-    }
-
     pub fn cmt_to_str(&self, cmt: cmt) -> ~str {
         match cmt.cat {
           cat_static_item => {
@@ -1174,48 +1153,6 @@ pub fn cmt_to_str(&self, cmt: cmt) -> ~str {
           }
         }
     }
-
-    pub fn region_to_str(&self, r: ty::Region) -> ~str {
-        region_ptr_to_str(self.tcx(), r)
-    }
-}
-
-/// The node_id here is the node of the expression that references the field.
-/// This function looks it up in the def map in case the type happens to be
-/// an enum to determine which variant is in use.
-pub fn field_mutbl(tcx: &ty::ctxt,
-                   base_ty: ty::t,
-                   // FIXME #6993: change type to Name
-                   f_name: ast::Ident,
-                   node_id: ast::NodeId)
-                -> Option<ast::Mutability> {
-    // Need to refactor so that struct/enum fields can be treated uniformly.
-    match ty::get(base_ty).sty {
-      ty::ty_struct(did, _) => {
-        let r = ty::lookup_struct_fields(tcx, did);
-        for fld in r.iter() {
-            if fld.name == f_name.name {
-                return Some(ast::MutImmutable);
-            }
-        }
-      }
-      ty::ty_enum(..) => {
-        match tcx.def_map.borrow().get_copy(&node_id) {
-          ast::DefVariant(_, variant_id, _) => {
-            let r = ty::lookup_struct_fields(tcx, variant_id);
-            for fld in r.iter() {
-                if fld.name == f_name.name {
-                    return Some(ast::MutImmutable);
-                }
-            }
-          }
-          _ => {}
-        }
-      }
-      _ => { }
-    }
-
-    return None;
 }
 
 pub enum InteriorSafety {
index e9d01b9048f919041ab17e0ca00491dccf144373..2d50d2e0f772b45376ed17d392f02f598823496c 100644 (file)
@@ -86,12 +86,6 @@ pub fn pat_bindings(dm: resolve::DefMap,
     });
 }
 
-pub fn pat_binding_ids(dm: resolve::DefMap, pat: &Pat) -> Vec<NodeId> {
-    let mut found = Vec::new();
-    pat_bindings(dm, pat, |_bm, b_id, _sp, _pt| found.push(b_id) );
-    return found;
-}
-
 /// Checks if the pattern contains any patterns that bind something to
 /// an ident, e.g. `foo`, or `Foo(foo)` or `foo @ Bar(..)`.
 pub fn pat_contains_bindings(dm: resolve::DefMap, pat: &Pat) -> bool {
index e5644dbd246f4bb87f1cfb469f08327ed9f36db5..9d9faee36450a4fb0e9ddae98e9938c03c06b186 100644 (file)
@@ -14,6 +14,7 @@
 
 use std::mem::replace;
 
+use metadata::csearch;
 use middle::lint;
 use middle::resolve;
 use middle::ty;
@@ -358,6 +359,12 @@ enum PrivacyResult {
     DisallowedBy(ast::NodeId),
 }
 
+enum FieldName {
+    UnnamedField(uint), // index
+    // FIXME #6993: change type (and name) from Ident to Name
+    NamedField(ast::Ident),
+}
+
 impl<'a> PrivacyVisitor<'a> {
     // used when debugging
     fn nodestr(&self, id: ast::NodeId) -> ~str {
@@ -560,18 +567,23 @@ fn ensure_public(&self, span: Span, to_check: ast::DefId,
     }
 
     // Checks that a field is in scope.
-    // FIXME #6993: change type (and name) from Ident to Name
-    fn check_field(&mut self, span: Span, id: ast::DefId, ident: ast::Ident) {
-        for field in ty::lookup_struct_fields(self.tcx, id).iter() {
-            if field.name != ident.name { continue; }
-            if field.vis == ast::Public { break }
-            if !is_local(field.id) ||
-               !self.private_accessible(field.id.node) {
-                self.tcx.sess.span_err(span,
-                                       format!("field `{}` is private",
-                                               token::get_ident(ident)))
+    fn check_field(&mut self, span: Span, id: ast::DefId,
+                   name: FieldName) {
+        let fields = ty::lookup_struct_fields(self.tcx, id);
+        let field = match name {
+            NamedField(ident) => {
+                fields.iter().find(|f| f.name == ident.name).unwrap()
             }
-            break;
+            UnnamedField(idx) => fields.get(idx)
+        };
+        if field.vis == ast::Public { return }
+        if !is_local(field.id) || !self.private_accessible(field.id.node) {
+            let msg = match name {
+                NamedField(name) => format!("field `{}` is private",
+                                            token::get_ident(name)),
+                UnnamedField(idx) => format!("field \\#{} is private", idx + 1),
+            };
+            self.tcx.sess.span_err(span, msg);
         }
     }
 
@@ -634,10 +646,11 @@ fn check_path(&mut self, span: Span, path_id: ast::NodeId, path: &ast::Path) {
                             _ => {},
                         }
                     }
-                    // If an import is not used in either namespace, we still want to check
-                    // that it could be legal. Therefore we check in both namespaces and only
-                    // report an error if both would be illegal. We only report one error,
-                    // even if it is illegal to import from both namespaces.
+                    // If an import is not used in either namespace, we still
+                    // want to check that it could be legal. Therefore we check
+                    // in both namespaces and only report an error if both would
+                    // be illegal. We only report one error, even if it is
+                    // illegal to import from both namespaces.
                     match (value_priv, check_value, type_priv, check_type) {
                         (Some(p), resolve::Unused, None, _) |
                         (None, _, Some(p), resolve::Unused) => {
@@ -701,7 +714,8 @@ fn check_method(&mut self, span: Span, origin: MethodOrigin,
             // is whether the trait itself is accessible or not.
             MethodParam(MethodParam { trait_id: trait_id, .. }) |
             MethodObject(MethodObject { trait_id: trait_id, .. }) => {
-                self.report_error(self.ensure_public(span, trait_id, None, "source trait"));
+                self.report_error(self.ensure_public(span, trait_id, None,
+                                                     "source trait"));
             }
         }
     }
@@ -726,7 +740,7 @@ fn visit_expr(&mut self, expr: &ast::Expr, _: ()) {
                 match ty::get(ty::expr_ty_adjusted(self.tcx, base,
                                                    &*self.method_map.borrow())).sty {
                     ty::ty_struct(id, _) => {
-                        self.check_field(expr.span, id, ident);
+                        self.check_field(expr.span, id, NamedField(ident));
                     }
                     _ => {}
                 }
@@ -749,7 +763,8 @@ fn visit_expr(&mut self, expr: &ast::Expr, _: ()) {
                 match ty::get(ty::expr_ty(self.tcx, expr)).sty {
                     ty::ty_struct(id, _) => {
                         for field in (*fields).iter() {
-                            self.check_field(expr.span, id, field.ident.node);
+                            self.check_field(expr.span, id,
+                                             NamedField(field.ident.node));
                         }
                     }
                     ty::ty_enum(_, _) => {
@@ -757,7 +772,7 @@ fn visit_expr(&mut self, expr: &ast::Expr, _: ()) {
                             ast::DefVariant(_, variant_id, _) => {
                                 for field in fields.iter() {
                                     self.check_field(expr.span, variant_id,
-                                                     field.ident.node);
+                                                     NamedField(field.ident.node));
                                 }
                             }
                             _ => self.tcx.sess.span_bug(expr.span,
@@ -772,6 +787,46 @@ fn visit_expr(&mut self, expr: &ast::Expr, _: ()) {
                                                             struct type?!"),
                 }
             }
+            ast::ExprPath(..) => {
+                let guard = |did: ast::DefId| {
+                    let fields = ty::lookup_struct_fields(self.tcx, did);
+                    let any_priv = fields.iter().any(|f| {
+                        f.vis != ast::Public && (
+                            !is_local(f.id) ||
+                            !self.private_accessible(f.id.node))
+                    });
+                    if any_priv {
+                        self.tcx.sess.span_err(expr.span,
+                            "cannot invoke tuple struct constructor \
+                             with private fields");
+                    }
+                };
+                match self.tcx.def_map.borrow().find(&expr.id) {
+                    Some(&ast::DefStruct(did)) => {
+                        guard(if is_local(did) {
+                            local_def(self.tcx.map.get_parent(did.node))
+                        } else {
+                            // "tuple structs" with zero fields (such as
+                            // `pub struct Foo;`) don't have a ctor_id, hence
+                            // the unwrap_or to the same struct id.
+                            let maybe_did =
+                                csearch::get_tuple_struct_definition_if_ctor(
+                                    &self.tcx.sess.cstore, did);
+                            maybe_did.unwrap_or(did)
+                        })
+                    }
+                    // Tuple struct constructors across crates are identified as
+                    // DefFn types, so we explicitly handle that case here.
+                    Some(&ast::DefFn(did, _)) if !is_local(did) => {
+                        match csearch::get_tuple_struct_definition_if_ctor(
+                                    &self.tcx.sess.cstore, did) {
+                            Some(did) => guard(did),
+                            None => {}
+                        }
+                    }
+                    _ => {}
+                }
+            }
             _ => {}
         }
 
@@ -821,7 +876,8 @@ fn visit_pat(&mut self, pattern: &ast::Pat, _: ()) {
                 match ty::get(ty::pat_ty(self.tcx, pattern)).sty {
                     ty::ty_struct(id, _) => {
                         for field in fields.iter() {
-                            self.check_field(pattern.span, id, field.ident);
+                            self.check_field(pattern.span, id,
+                                             NamedField(field.ident));
                         }
                     }
                     ty::ty_enum(_, _) => {
@@ -829,7 +885,7 @@ fn visit_pat(&mut self, pattern: &ast::Pat, _: ()) {
                             Some(&ast::DefVariant(_, variant_id, _)) => {
                                 for field in fields.iter() {
                                     self.check_field(pattern.span, variant_id,
-                                                     field.ident);
+                                                     NamedField(field.ident));
                                 }
                             }
                             _ => self.tcx.sess.span_bug(pattern.span,
@@ -844,6 +900,27 @@ fn visit_pat(&mut self, pattern: &ast::Pat, _: ()) {
                                                  struct type?!"),
                 }
             }
+
+            // Patterns which bind no fields are allowable (the path is check
+            // elsewhere).
+            ast::PatEnum(_, Some(ref fields)) => {
+                match ty::get(ty::pat_ty(self.tcx, pattern)).sty {
+                    ty::ty_struct(id, _) => {
+                        for (i, field) in fields.iter().enumerate() {
+                            match field.node {
+                                ast::PatWild(..) => continue,
+                                _ => {}
+                            }
+                            self.check_field(field.span, id, UnnamedField(i));
+                        }
+                    }
+                    ty::ty_enum(..) => {
+                        // enum fields have no privacy at this time
+                    }
+                    _ => {}
+                }
+
+            }
             _ => {}
         }
 
index 247209539127cf0bdd067e0cbcc973a154522d97..ad940113a86c498c8c2e74f38549e087d325fdd1 100644 (file)
@@ -149,6 +149,7 @@ pub fn opt_encl_scope(&self, id: ast::NodeId) -> Option<ast::NodeId> {
         self.scope_map.borrow().find(&id).map(|x| *x)
     }
 
+    #[allow(dead_code)] // used in middle::cfg
     pub fn encl_scope(&self, id: ast::NodeId) -> ast::NodeId {
         //! Returns the narrowest scope that encloses `id`, if any.
         match self.scope_map.borrow().find(&id) {
@@ -203,12 +204,6 @@ pub fn temporary_scope(&self, expr_id: ast::NodeId) -> Option<ast::NodeId> {
         return Some(id);
     }
 
-    pub fn encl_region(&self, id: ast::NodeId) -> ty::Region {
-        //! Returns the narrowest scope region that encloses `id`, if any.
-
-        ty::ReScope(self.encl_scope(id))
-    }
-
     pub fn var_region(&self, id: ast::NodeId) -> ty::Region {
         //! Returns the lifetime of the variable `id`.
 
index c727744b4c76574170236390dfa91aa0615a83a3..b42721b754b54f788f47c0f548871c6cbd9dc62a 100644 (file)
@@ -644,25 +644,6 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
     }
 }
 
-/// Access a field, at a point when the value's case is known.
-pub fn deref_ty(ccx: &CrateContext, r: &Repr) -> ty::t {
-    match *r {
-        CEnum(..) => {
-            ccx.sess().bug("deref of c-like enum")
-        }
-        Univariant(ref st, _) => {
-            *st.fields.get(0)
-        }
-        General(_, ref cases) => {
-            assert!(cases.len() == 1);
-            *cases.get(0).fields.get(0)
-        }
-        NullablePointer{ .. } => {
-            ccx.sess().bug("deref of nullable ptr")
-        }
-    }
-}
-
 /// Access a field, at a point when the value's case is known.
 pub fn trans_field_ptr(bcx: &Block, r: &Repr, val: ValueRef, discr: Disr,
                        ix: uint) -> ValueRef {
@@ -896,11 +877,3 @@ fn const_struct_field(ccx: &CrateContext, val: ValueRef, ix: uint)
         real_ix = real_ix + 1;
     }
 }
-
-/// Is it safe to bitcast a value to the one field of its one variant?
-pub fn is_newtypeish(r: &Repr) -> bool {
-    match *r {
-        Univariant(ref st, false) => st.fields.len() == 1,
-        _ => false
-    }
-}
index 8ac7bd1b66b683638da3a3bc601331f78240ae09..09bbb95fdd04e29ca825434ff1d3c9b8abe245c3 100644 (file)
 use std::libc::c_uint;
 use std::local_data;
 use syntax::abi::{X86, X86_64, Arm, Mips, Rust, RustIntrinsic};
-use syntax::ast_map::PathName;
 use syntax::ast_util::{local_def, is_local};
 use syntax::attr::AttrMetaMethods;
 use syntax::attr;
 use syntax::codemap::Span;
 use syntax::parse::token::InternedString;
-use syntax::parse::token;
 use syntax::visit::Visitor;
 use syntax::visit;
 use syntax::{ast, ast_util, ast_map};
@@ -447,10 +445,6 @@ pub fn malloc_general<'a>(bcx: &'a Block<'a>, t: ty::t, heap: heap)
 
 // Type descriptor and type glue stuff
 
-pub fn get_tydesc_simple(ccx: &CrateContext, t: ty::t) -> ValueRef {
-    get_tydesc(ccx, t).tydesc
-}
-
 pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
     match ccx.tydescs.borrow().find(&t) {
         Some(&inf) => return inf,
@@ -464,6 +458,7 @@ pub fn get_tydesc(ccx: &CrateContext, t: ty::t) -> @tydesc_info {
     return inf;
 }
 
+#[allow(dead_code)] // useful
 pub fn set_optimize_for_size(f: ValueRef) {
     lib::llvm::SetFunctionAttribute(f, lib::llvm::OptimizeForSizeAttribute)
 }
@@ -472,6 +467,7 @@ pub fn set_no_inline(f: ValueRef) {
     lib::llvm::SetFunctionAttribute(f, lib::llvm::NoInlineAttribute)
 }
 
+#[allow(dead_code)] // useful
 pub fn set_no_unwind(f: ValueRef) {
     lib::llvm::SetFunctionAttribute(f, lib::llvm::NoUnwindAttribute)
 }
@@ -667,19 +663,6 @@ fn die(cx: &Block) -> ! {
 pub type val_and_ty_fn<'r,'b> =
     'r |&'b Block<'b>, ValueRef, ty::t| -> &'b Block<'b>;
 
-pub fn load_inbounds<'a>(cx: &'a Block<'a>, p: ValueRef, idxs: &[uint])
-                     -> ValueRef {
-    return Load(cx, GEPi(cx, p, idxs));
-}
-
-pub fn store_inbounds<'a>(
-                      cx: &'a Block<'a>,
-                      v: ValueRef,
-                      p: ValueRef,
-                      idxs: &[uint]) {
-    Store(cx, v, GEPi(cx, p, idxs));
-}
-
 // Iterates through the elements of a structural type.
 pub fn iter_structural_ty<'r,
                           'b>(
@@ -872,8 +855,8 @@ pub fn trans_external_path(ccx: &CrateContext, did: ast::DefId, t: ty::t) -> Val
     let name = csearch::get_symbol(&ccx.sess().cstore, did);
     match ty::get(t).sty {
         ty::ty_bare_fn(ref fn_ty) => {
-            match fn_ty.abis.for_target(ccx.sess().targ_cfg.os,
-                                        ccx.sess().targ_cfg.arch) {
+            match fn_ty.abi.for_target(ccx.sess().targ_cfg.os,
+                                       ccx.sess().targ_cfg.arch) {
                 Some(Rust) | Some(RustIntrinsic) => {
                     get_extern_rust_fn(ccx,
                                        fn_ty.sig.inputs.as_slice(),
@@ -882,7 +865,7 @@ pub fn trans_external_path(ccx: &CrateContext, did: ast::DefId, t: ty::t) -> Val
                                        did)
                 }
                 Some(..) | None => {
-                    let c = foreign::llvm_calling_convention(ccx, fn_ty.abis);
+                    let c = foreign::llvm_calling_convention(ccx, fn_ty.abi);
                     let cconv = c.unwrap_or(lib::llvm::CCallConv);
                     let llty = type_of_fn_from_ty(ccx, t);
                     get_extern_fn(&mut *ccx.externs.borrow_mut(), ccx.llmod,
@@ -975,29 +958,6 @@ pub fn need_invoke(bcx: &Block) -> bool {
     bcx.fcx.needs_invoke()
 }
 
-pub fn do_spill(bcx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
-    if ty::type_is_bot(t) {
-        return C_null(Type::i8p(bcx.ccx()));
-    }
-    let llptr = alloc_ty(bcx, t, "");
-    Store(bcx, v, llptr);
-    return llptr;
-}
-
-// Since this function does *not* root, it is the caller's responsibility to
-// ensure that the referent is pointed to by a root.
-pub fn do_spill_noroot(cx: &Block, v: ValueRef) -> ValueRef {
-    let llptr = alloca(cx, val_ty(v), "");
-    Store(cx, v, llptr);
-    return llptr;
-}
-
-pub fn spill_if_immediate(cx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
-    let _icx = push_ctxt("spill_if_immediate");
-    if type_is_immediate(cx.ccx(), t) { return do_spill(cx, v, t); }
-    return v;
-}
-
 pub fn load_if_immediate(cx: &Block, v: ValueRef, t: ty::t) -> ValueRef {
     let _icx = push_ctxt("load_if_immediate");
     if type_is_immediate(cx.ccx(), t) { return Load(cx, v); }
@@ -1040,20 +1000,6 @@ pub fn raw_block<'a>(
     Block::new(llbb, is_lpad, None, fcx)
 }
 
-pub fn block_locals(b: &ast::Block, it: |@ast::Local|) {
-    for s in b.stmts.iter() {
-        match s.node {
-          ast::StmtDecl(d, _) => {
-            match d.node {
-              ast::DeclLocal(ref local) => it(*local),
-              _ => {} /* fall through */
-            }
-          }
-          _ => {} /* fall through */
-        }
-    }
-}
-
 pub fn with_cond<'a>(
                  bcx: &'a Block<'a>,
                  val: ValueRef,
@@ -1173,10 +1119,6 @@ pub fn arrayalloca(cx: &Block, ty: Type, v: ValueRef) -> ValueRef {
     return ArrayAlloca(cx, ty, v);
 }
 
-pub struct BasicBlocks {
-    sa: BasicBlockRef,
-}
-
 // Creates and returns space for, or returns the argument representing, the
 // slot where the return value of the function must go.
 pub fn make_return_pointer(fcx: &FunctionContext, output_type: ty::t)
@@ -1659,7 +1601,7 @@ fn visit_item(&mut self, i: &ast::Item, _:()) {
 pub fn trans_item(ccx: &CrateContext, item: &ast::Item) {
     let _icx = push_ctxt("trans_item");
     match item.node {
-      ast::ItemFn(decl, purity, _abis, ref generics, body) => {
+      ast::ItemFn(decl, purity, _abi, ref generics, body) => {
         if purity == ast::ExternFn  {
             let llfndecl = get_item_val(ccx, item.id);
             foreign::trans_rust_fn_with_foreign_abi(
@@ -1779,7 +1721,7 @@ fn register_fn(ccx: &CrateContext,
                -> ValueRef {
     let f = match ty::get(node_type).sty {
         ty::ty_bare_fn(ref f) => {
-            assert!(f.abis.is_rust() || f.abis.is_intrinsic());
+            assert!(f.abi == Rust || f.abi == RustIntrinsic);
             f
         }
         _ => fail!("expected bare rust fn or an intrinsic")
@@ -2055,8 +1997,8 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
 
             match ni.node {
                 ast::ForeignItemFn(..) => {
-                    let abis = ccx.tcx.map.get_foreign_abis(id);
-                    foreign::register_foreign_item_fn(ccx, abis, ni)
+                    let abi = ccx.tcx.map.get_foreign_abi(id);
+                    foreign::register_foreign_item_fn(ccx, abi, ni)
                 }
                 ast::ForeignItemStatic(..) => {
                     foreign::register_static(ccx, ni)
@@ -2142,11 +2084,6 @@ fn register_method(ccx: &CrateContext, id: ast::NodeId,
     llfn
 }
 
-pub fn vp2i(cx: &Block, v: ValueRef) -> ValueRef {
-    let ccx = cx.ccx();
-    return PtrToInt(cx, v, ccx.int_type);
-}
-
 pub fn p2i(ccx: &CrateContext, v: ValueRef) -> ValueRef {
     unsafe {
         return llvm::LLVMConstPtrToInt(v, ccx.int_type.to_ref());
@@ -2315,18 +2252,6 @@ macro_rules! compatible_ifn (
     }
 }
 
-pub fn trap(bcx: &Block) {
-    match bcx.ccx().intrinsics.find_equiv(& &"llvm.trap") {
-      Some(&x) => { Call(bcx, x, [], []); },
-      _ => bcx.sess().bug("unbound llvm.trap in trap")
-    }
-}
-
-pub fn symname(name: &str, hash: &str, vers: &str) -> ~str {
-    let path = [PathName(token::intern(name))];
-    link::exported_name(ast_map::Values(path.iter()).chain(None), hash, vers)
-}
-
 pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::EncodeInlinedItem<'r>)
     -> encoder::EncodeParams<'r> {
 
index 074c9f4fec515d80e621231c16b4ebb8280f8cfa..303ad5fbce2ce25283fc13cd4820f60e9121297f 100644 (file)
@@ -12,7 +12,7 @@
 use middle::trans::value::{Users, Value};
 use std::iter::{Filter, Map};
 
-pub struct BasicBlock(BasicBlockRef);
+pub struct BasicBlock(pub BasicBlockRef);
 
 pub type Preds<'a> = Map<'a, Value, BasicBlock, Filter<'a, Value, Users>>;
 
index c7c0d51b3abd8d400f332598ec21280e7e62b79d..f40a9ede8622e268c916faa2506bf8f85c0399e9 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(dead_code)] // FFI wrappers
 
 use lib::llvm::llvm;
 use lib::llvm::{CallConv, AtomicBinOp, AtomicOrdering, AsmDialect};
index 2703ddddc8b7fe32d094a6912929ad57cdf2ef45..07017de2bc2bcd1dadf67c5882860ccc95385f30 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(dead_code)] // FFI wrappers
+
 use lib;
 use lib::llvm::llvm;
 use lib::llvm::{CallConv, AtomicBinOp, AtomicOrdering, AsmDialect};
index 9ce277a7de904691b6cd0f261f640271982cb607..2c9be587eaa9ec3bbdfa81b4cc6b191e5d3a5522 100644 (file)
@@ -79,10 +79,6 @@ pub fn ignore(ty: Type) -> ArgType {
         }
     }
 
-    pub fn is_direct(&self) -> bool {
-        return self.kind == Direct;
-    }
-
     pub fn is_indirect(&self) -> bool {
         return self.kind == Indirect;
     }
index dae48512ac2a787b1ef454612c55855aac0b2554..13fcaa486f172296db41c16f41034d5f79a903ce 100644 (file)
@@ -50,7 +50,7 @@
 use middle::trans::type_::Type;
 
 use syntax::ast;
-use syntax::abi::AbiSet;
+use synabi = syntax::abi;
 use syntax::ast_map;
 
 pub struct MethodData {
@@ -363,7 +363,7 @@ pub fn trans_fn_ref_with_vtables(
 
         match map_node {
             ast_map::NodeForeignItem(_) => {
-                tcx.map.get_foreign_abis(def_id.node).is_intrinsic()
+                tcx.map.get_foreign_abi(def_id.node) == synabi::RustIntrinsic
             }
             _ => false
         }
@@ -512,48 +512,6 @@ pub fn trans_lang_call<'a>(
                              dest)
 }
 
-pub fn trans_lang_call_with_type_params<'a>(
-                                        bcx: &'a Block<'a>,
-                                        did: ast::DefId,
-                                        args: &[ValueRef],
-                                        type_params: &[ty::t],
-                                        dest: expr::Dest)
-                                        -> &'a Block<'a> {
-    let fty;
-    if did.krate == ast::LOCAL_CRATE {
-        fty = ty::node_id_to_type(bcx.tcx(), did.node);
-    } else {
-        fty = csearch::get_type(bcx.tcx(), did).ty;
-    }
-
-    return callee::trans_call_inner(
-        bcx,
-        None,
-        fty,
-        |bcx, _| {
-            let callee =
-                trans_fn_ref_with_vtables_to_callee(bcx, did, 0,
-                                                    type_params,
-                                                    None);
-
-            let new_llval;
-            match callee.data {
-                Fn(llfn) => {
-                    let substituted = ty::subst_tps(callee.bcx.tcx(),
-                                                    type_params,
-                                                    None,
-                                                    fty);
-                    let llfnty = type_of::type_of(callee.bcx.ccx(),
-                                                      substituted);
-                    new_llval = PointerCast(callee.bcx, llfn, llfnty);
-                }
-                _ => fail!()
-            }
-            Callee { bcx: callee.bcx, data: Fn(new_llval) }
-        },
-        ArgVals(args), Some(dest)).bcx;
-}
-
 pub fn trans_call_inner<'a>(
                         bcx: &'a Block<'a>,
                         call_info: Option<NodeInfo>,
@@ -614,13 +572,11 @@ pub fn trans_call_inner<'a>(
     };
 
     let (abi, ret_ty) = match ty::get(callee_ty).sty {
-        ty::ty_bare_fn(ref f) => (f.abis, f.sig.output),
-        ty::ty_closure(ref f) => (AbiSet::Rust(), f.sig.output),
+        ty::ty_bare_fn(ref f) => (f.abi, f.sig.output),
+        ty::ty_closure(ref f) => (synabi::Rust, f.sig.output),
         _ => fail!("expected bare rust fn or closure in trans_call_inner")
     };
-    let is_rust_fn =
-        abi.is_rust() ||
-        abi.is_intrinsic();
+    let is_rust_fn = abi == synabi::Rust || abi == synabi::RustIntrinsic;
 
     // Generate a location to store the result. If the user does
     // not care about the result, just make a stack slot.
index 40b09b063a0cbbe0269a82870012fb698cf4291b..97638f7e4690ab6b2e13ca0b055a00e745a1357b 100644 (file)
@@ -24,7 +24,6 @@
 use middle::trans::datum::{Datum, Lvalue};
 use middle::trans::debuginfo;
 use middle::trans::type_::Type;
-use middle::ty::substs;
 use middle::ty;
 use middle::typeck;
 use util::ppaux::Repr;
@@ -456,14 +455,6 @@ pub fn expr_to_str(&self, e: &ast::Expr) -> ~str {
         e.repr(self.tcx())
     }
 
-    pub fn expr_is_lval(&self, e: &ast::Expr) -> bool {
-        ty::expr_is_lval(self.tcx(), self.ccx().maps.method_map, e)
-    }
-
-    pub fn expr_kind(&self, e: &ast::Expr) -> ty::ExprKind {
-        ty::expr_kind(self.tcx(), self.ccx().maps.method_map, e)
-    }
-
     pub fn def(&self, nid: ast::NodeId) -> ast::Def {
         match self.tcx().def_map.borrow().find(&nid) {
             Some(&v) => v,
@@ -504,13 +495,6 @@ pub fn rslt<'a>(bcx: &'a Block<'a>, val: ValueRef) -> Result<'a> {
     }
 }
 
-impl<'a> Result<'a> {
-    pub fn unpack(&self, bcx: &mut &'a Block<'a>) -> ValueRef {
-        *bcx = self.bcx;
-        return self.val;
-    }
-}
-
 pub fn val_ty(v: ValueRef) -> Type {
     unsafe {
         Type::from_ref(llvm::LLVMTypeOf(v))
@@ -749,22 +733,6 @@ pub struct mono_id_ {
 
 pub type mono_id = @mono_id_;
 
-pub fn umax(cx: &Block, a: ValueRef, b: ValueRef) -> ValueRef {
-    let cond = build::ICmp(cx, lib::llvm::IntULT, a, b);
-    return build::Select(cx, cond, b, a);
-}
-
-pub fn umin(cx: &Block, a: ValueRef, b: ValueRef) -> ValueRef {
-    let cond = build::ICmp(cx, lib::llvm::IntULT, a, b);
-    return build::Select(cx, cond, a, b);
-}
-
-pub fn align_to(cx: &Block, off: ValueRef, align: ValueRef) -> ValueRef {
-    let mask = build::Sub(cx, align, C_int(cx.ccx(), 1));
-    let bumped = build::Add(cx, off, mask);
-    return build::And(cx, bumped, build::Not(cx, mask));
-}
-
 pub fn monomorphize_type(bcx: &Block, t: ty::t) -> ty::t {
     match bcx.fcx.param_substs {
         Some(substs) => {
@@ -928,14 +896,6 @@ pub fn find_vtable(tcx: &ty::ctxt,
     param_bounds.get(n_bound).clone()
 }
 
-pub fn dummy_substs(tps: Vec<ty::t> ) -> ty::substs {
-    substs {
-        regions: ty::ErasedRegions,
-        self_ty: None,
-        tps: tps
-    }
-}
-
 pub fn filename_and_line_num_from_span(bcx: &Block, span: Span)
                                        -> (ValueRef, ValueRef) {
     let loc = bcx.sess().codemap().lookup_char_pos(span.lo);
index a7fed4fa60d3fe728a57342006d5b971aa7f72d2..f98a77eed65a004ce886ba8fcfd29c63f3bfd818 100644 (file)
@@ -20,7 +20,6 @@
 use middle::trans::adt;
 use middle::trans::base;
 use middle::trans::builder::Builder;
-use middle::trans::common::{C_i32, C_null};
 use middle::trans::common::{mono_id,ExternMap,tydesc_info,BuilderRef_res,Stats};
 use middle::trans::debuginfo;
 use middle::trans::type_::Type;
@@ -30,7 +29,6 @@
 
 use std::cell::{Cell, RefCell};
 use std::c_str::ToCStr;
-use std::libc::c_uint;
 use std::ptr;
 use collections::{HashMap, HashSet};
 use syntax::ast;
@@ -51,45 +49,45 @@ pub struct CrateContext {
     pub link_meta: LinkMeta,
     pub drop_glues: RefCell<HashMap<ty::t, ValueRef>>,
     pub tydescs: RefCell<HashMap<ty::t, @tydesc_info>>,
-    // Set when running emit_tydescs to enforce that no more tydescs are
-    // created.
+    /// Set when running emit_tydescs to enforce that no more tydescs are
+    /// created.
     pub finished_tydescs: Cell<bool>,
-    // Track mapping of external ids to local items imported for inlining
+    /// Track mapping of external ids to local items imported for inlining
     pub external: RefCell<DefIdMap<Option<ast::NodeId>>>,
-    // Backwards version of the `external` map (inlined items to where they
-    // came from)
+    /// Backwards version of the `external` map (inlined items to where they
+    /// came from)
     pub external_srcs: RefCell<NodeMap<ast::DefId>>,
-    // A set of static items which cannot be inlined into other crates. This
-    // will pevent in IIItem() structures from being encoded into the metadata
-    // that is generated
+    /// A set of static items which cannot be inlined into other crates. This
+    /// will pevent in IIItem() structures from being encoded into the metadata
+    /// that is generated
     pub non_inlineable_statics: RefCell<NodeSet>,
-    // Cache instances of monomorphized functions
+    /// Cache instances of monomorphized functions
     pub monomorphized: RefCell<HashMap<mono_id, ValueRef>>,
     pub monomorphizing: RefCell<DefIdMap<uint>>,
-    // Cache generated vtables
+    /// Cache generated vtables
     pub vtables: RefCell<HashMap<(ty::t, mono_id), ValueRef>>,
-    // Cache of constant strings,
+    /// Cache of constant strings,
     pub const_cstr_cache: RefCell<HashMap<InternedString, ValueRef>>,
 
-    // Reverse-direction for const ptrs cast from globals.
-    // Key is an int, cast from a ValueRef holding a *T,
-    // Val is a ValueRef holding a *[T].
-    //
-    // Needed because LLVM loses pointer->pointee association
-    // when we ptrcast, and we have to ptrcast during translation
-    // of a [T] const because we form a slice, a [*T,int] pair, not
-    // a pointer to an LLVM array type.
+    /// Reverse-direction for const ptrs cast from globals.
+    /// Key is an int, cast from a ValueRef holding a *T,
+    /// Val is a ValueRef holding a *[T].
+    ///
+    /// Needed because LLVM loses pointer->pointee association
+    /// when we ptrcast, and we have to ptrcast during translation
+    /// of a [T] const because we form a slice, a [*T,int] pair, not
+    /// a pointer to an LLVM array type.
     pub const_globals: RefCell<HashMap<int, ValueRef>>,
 
-    // Cache of emitted const values
+    /// Cache of emitted const values
     pub const_values: RefCell<NodeMap<ValueRef>>,
 
-    // Cache of external const values
+    /// Cache of external const values
     pub extern_const_values: RefCell<DefIdMap<ValueRef>>,
 
     pub impl_method_cache: RefCell<HashMap<(ast::DefId, ast::Name), ast::DefId>>,
 
-    // Cache of closure wrappers for bare fn's.
+    /// Cache of closure wrappers for bare fn's.
     pub closure_bare_wrapper_cache: RefCell<HashMap<ValueRef, ValueRef>>,
 
     pub lltypes: RefCell<HashMap<ty::t, Type>>,
@@ -104,9 +102,9 @@ pub struct CrateContext {
     pub int_type: Type,
     pub opaque_vec_type: Type,
     pub builder: BuilderRef_res,
-    // Set when at least one function uses GC. Needed so that
-    // decl_gc_metadata knows whether to link to the module metadata, which
-    // is not emitted by LLVM's GC pass when no functions use GC.
+    /// Set when at least one function uses GC. Needed so that
+    /// decl_gc_metadata knows whether to link to the module metadata, which
+    /// is not emitted by LLVM's GC pass when no functions use GC.
     pub uses_gc: bool,
     pub dbg_cx: Option<debuginfo::CrateDebugContext>,
 }
@@ -232,36 +230,6 @@ pub fn builder<'a>(&'a self) -> Builder<'a> {
         Builder::new(self)
     }
 
-    pub fn const_inbounds_gepi(&self,
-                               pointer: ValueRef,
-                               indices: &[uint]) -> ValueRef {
-        debug!("const_inbounds_gepi: pointer={} indices={:?}",
-               self.tn.val_to_str(pointer), indices);
-        let v: Vec<ValueRef> =
-            indices.iter().map(|i| C_i32(self, *i as i32)).collect();
-        unsafe {
-            llvm::LLVMConstInBoundsGEP(pointer,
-                                       v.as_ptr(),
-                                       indices.len() as c_uint)
-        }
-    }
-
-    pub fn offsetof_gep(&self,
-                        llptr_ty: Type,
-                        indices: &[uint]) -> ValueRef {
-        /*!
-         * Returns the offset of applying the given GEP indices
-         * to an instance of `llptr_ty`. Similar to `offsetof` in C,
-         * except that `llptr_ty` must be a pointer type.
-         */
-
-        unsafe {
-            let null = C_null(llptr_ty);
-            llvm::LLVMConstPtrToInt(self.const_inbounds_gepi(null, indices),
-                                    self.int_type.to_ref())
-        }
-    }
-
     pub fn tydesc_type(&self) -> Type {
         self.tn.find_type("tydesc").unwrap()
     }
index 9f48e4714d60dbdbd0b40709c83b8b24bfbee864..500a36c5dee60f7fc32527779158c1d425d5609c 100644 (file)
 use middle::trans::glue;
 use middle::trans::tvec;
 use middle::trans::type_of;
-use middle::trans::write_guard;
 use middle::ty;
 use util::ppaux::{ty_to_str};
 
 use syntax::ast;
-use syntax::codemap::Span;
 
 /**
  * A `Datum` encapsulates the result of evaluating an expression.  It
@@ -160,10 +158,6 @@ pub fn rvalue_scratch_datum(bcx: &Block,
     Datum(scratch, ty, Rvalue(ByRef))
 }
 
-pub fn is_by_value_type(ccx: &CrateContext, ty: ty::t) -> bool {
-    appropriate_rvalue_mode(ccx, ty) == ByValue
-}
-
 pub fn appropriate_rvalue_mode(ccx: &CrateContext, ty: ty::t) -> RvalueMode {
     /*!
      * Indicates the "appropriate" mode for this value,
@@ -389,10 +383,7 @@ fn match_kind<R>(self,
         }
     }
 
-    pub fn is_by_ref(&self) -> bool {
-        self.kind.is_by_ref()
-    }
-
+    #[allow(dead_code)] // potentially useful
     pub fn assert_lvalue(self, bcx: &Block) -> Datum<Lvalue> {
         /*!
          * Asserts that this datum *is* an lvalue and returns it.
@@ -632,6 +623,7 @@ pub fn shallow_copy_and_take<'a>(&self,
         glue::take_ty(bcx, dst, self.ty)
     }
 
+    #[allow(dead_code)] // useful for debugging
     pub fn to_str(&self, ccx: &CrateContext) -> ~str {
         format!("Datum({}, {}, {:?})",
              ccx.tn.val_to_str(self.val),
@@ -645,16 +637,6 @@ pub fn appropriate_rvalue_mode(&self, ccx: &CrateContext) -> RvalueMode {
         appropriate_rvalue_mode(ccx, self.ty)
     }
 
-    pub fn root_and_write_guard<'a>(
-                                &self,
-                                bcx: &'a Block<'a>,
-                                span: Span,
-                                expr_id: ast::NodeId,
-                                derefs: uint)
-                                -> &'a Block<'a> {
-        write_guard::root_and_write_guard(self, bcx, span, expr_id, derefs)
-    }
-
     pub fn to_llscalarish<'a>(self, bcx: &'a Block<'a>) -> ValueRef {
         /*!
          * Converts `self` into a by-value `ValueRef`. Consumes this
@@ -688,16 +670,6 @@ pub fn to_expr_datumblock(self) -> DatumBlock<'a, Expr> {
 }
 
 impl<'a> DatumBlock<'a, Expr> {
-    pub fn assert_by_ref(self) -> DatumBlock<'a, Expr> {
-        assert!(self.datum.kind.is_by_ref());
-        self
-    }
-
-    pub fn store_to(self, dst: ValueRef) -> &'a Block<'a> {
-        let DatumBlock { bcx, datum } = self;
-        datum.store_to(bcx, dst)
-    }
-
     pub fn store_to_dest(self,
                          dest: expr::Dest,
                          expr_id: ast::NodeId) -> &'a Block<'a> {
@@ -705,22 +677,6 @@ pub fn store_to_dest(self,
         datum.store_to_dest(bcx, dest, expr_id)
     }
 
-    pub fn shallow_copy(self, dst: ValueRef) -> &'a Block<'a> {
-        self.datum.shallow_copy(self.bcx, dst)
-    }
-
-    pub fn ccx(&self) -> &'a CrateContext {
-        self.bcx.ccx()
-    }
-
-    pub fn tcx(&self) -> &'a ty::ctxt {
-        self.bcx.tcx()
-    }
-
-    pub fn to_str(&self) -> ~str {
-        self.datum.to_str(self.ccx())
-    }
-
     pub fn to_llbool(self) -> Result<'a> {
         let DatumBlock { datum, bcx } = self;
         rslt(bcx, datum.to_llbool(bcx))
index bd8c84e85e57be61d39f1898bf71c9d59d861dda..49a4a3ed25ca7aab7c0656776423d906106002ca 100644 (file)
@@ -67,7 +67,7 @@
 use util::common::indenter;
 use util::ppaux::Repr;
 use util::nodemap::NodeMap;
-use middle::trans::machine::llsize_of;
+use middle::trans::machine::{llsize_of, llsize_of_alloc};
 use middle::trans::type_::Type;
 
 use std::slice;
@@ -1200,12 +1200,19 @@ fn trans_boxed_expr<'a>(bcx: &'a Block<'a>,
         let size = llsize_of(bcx.ccx(), llty);
         let Result { bcx: bcx, val: val } = malloc_raw_dyn(bcx, contents_ty,
                                                            heap_exchange, size);
-        let custom_cleanup_scope = fcx.push_custom_cleanup_scope();
-        fcx.schedule_free_value(cleanup::CustomScope(custom_cleanup_scope),
-                                val, heap_exchange);
-        let bcx = trans_into(bcx, contents, SaveIn(val));
-        fcx.pop_custom_cleanup_scope(custom_cleanup_scope);
-        immediate_rvalue_bcx(bcx, val, box_ty).to_expr_datumblock()
+        // Unique boxes do not allocate for zero-size types. The standard library may assume
+        // that `free` is never called on the pointer returned for `~ZeroSizeType`.
+        if llsize_of_alloc(bcx.ccx(), llty) == 0 {
+            let bcx = trans_into(bcx, contents, SaveIn(val));
+            immediate_rvalue_bcx(bcx, val, box_ty).to_expr_datumblock()
+        } else {
+            let custom_cleanup_scope = fcx.push_custom_cleanup_scope();
+            fcx.schedule_free_value(cleanup::CustomScope(custom_cleanup_scope),
+                                    val, heap_exchange);
+            let bcx = trans_into(bcx, contents, SaveIn(val));
+            fcx.pop_custom_cleanup_scope(custom_cleanup_scope);
+            immediate_rvalue_bcx(bcx, val, box_ty).to_expr_datumblock()
+        }
     } else {
         let base::MallocResult { bcx, smart_ptr: bx, body } =
             base::malloc_general(bcx, contents_ty, heap);
index 158589393efd2ac763ade6020df5c8fcfc57e158..e70d7bf7568a8880773e9b0f1431b1fd654d5308 100644 (file)
@@ -27,7 +27,7 @@
 use middle::ty;
 use std::cmp;
 use std::libc::c_uint;
-use syntax::abi::{Cdecl, Aapcs, C, AbiSet, Win64};
+use syntax::abi::{Cdecl, Aapcs, C, Win64, Abi};
 use syntax::abi::{RustIntrinsic, Rust, Stdcall, Fastcall, System};
 use syntax::codemap::Span;
 use syntax::parse::token::{InternedString, special_idents};
@@ -73,10 +73,10 @@ struct LlvmSignature {
 // Calls to external functions
 
 pub fn llvm_calling_convention(ccx: &CrateContext,
-                               abis: AbiSet) -> Option<CallConv> {
+                               abi: Abi) -> Option<CallConv> {
     let os = ccx.sess().targ_cfg.os;
     let arch = ccx.sess().targ_cfg.arch;
-    abis.for_target(os, arch).map(|abi| {
+    abi.for_target(os, arch).map(|abi| {
         match abi {
             RustIntrinsic => {
                 // Intrinsics are emitted by monomorphic fn
@@ -180,27 +180,27 @@ pub fn register_static(ccx: &CrateContext,
     }
 }
 
-pub fn register_foreign_item_fn(ccx: &CrateContext, abis: AbiSet,
+pub fn register_foreign_item_fn(ccx: &CrateContext, abi: Abi,
                                 foreign_item: &ast::ForeignItem) -> ValueRef {
     /*!
      * Registers a foreign function found in a library.
      * Just adds a LLVM global.
      */
 
-    debug!("register_foreign_item_fn(abis={}, \
+    debug!("register_foreign_item_fn(abi={}, \
             path={}, \
             foreign_item.id={})",
-           abis.repr(ccx.tcx()),
+           abi.repr(ccx.tcx()),
            ccx.tcx.map.path_to_str(foreign_item.id),
            foreign_item.id);
 
-    let cc = match llvm_calling_convention(ccx, abis) {
+    let cc = match llvm_calling_convention(ccx, abi) {
         Some(cc) => cc,
         None => {
             ccx.sess().span_fatal(foreign_item.span,
                 format!("ABI `{}` has no suitable calling convention \
                       for target architecture",
-                      abis.user_string(ccx.tcx())));
+                      abi.user_string(ccx.tcx())));
         }
     };
 
@@ -263,8 +263,8 @@ pub fn trans_native_call<'a>(
            ccx.tn.val_to_str(llfn),
            ccx.tn.val_to_str(llretptr));
 
-    let (fn_abis, fn_sig) = match ty::get(callee_ty).sty {
-        ty::ty_bare_fn(ref fn_ty) => (fn_ty.abis, fn_ty.sig.clone()),
+    let (fn_abi, fn_sig) = match ty::get(callee_ty).sty {
+        ty::ty_bare_fn(ref fn_ty) => (fn_ty.abi, fn_ty.sig.clone()),
         _ => ccx.sess().bug("trans_native_call called on non-function type")
     };
     let llsig = foreign_signature(ccx, &fn_sig, passed_arg_tys.as_slice());
@@ -354,14 +354,14 @@ pub fn trans_native_call<'a>(
         llargs_foreign.push(llarg_foreign);
     }
 
-    let cc = match llvm_calling_convention(ccx, fn_abis) {
+    let cc = match llvm_calling_convention(ccx, fn_abi) {
         Some(cc) => cc,
         None => {
             // FIXME(#8357) We really ought to report a span here
             ccx.sess().fatal(
                 format!("ABI string `{}` has no suitable ABI \
                         for target architecture",
-                        fn_abis.user_string(ccx.tcx())));
+                        fn_abi.user_string(ccx.tcx())));
         }
     };
 
@@ -435,9 +435,9 @@ pub fn trans_foreign_mod(ccx: &CrateContext, foreign_mod: &ast::ForeignMod) {
     for &foreign_item in foreign_mod.items.iter() {
         match foreign_item.node {
             ast::ForeignItemFn(..) => {
-                let abis = foreign_mod.abis;
-                if !(abis.is_rust() || abis.is_intrinsic()) {
-                    register_foreign_item_fn(ccx, abis, foreign_item);
+                match foreign_mod.abi {
+                    Rust | RustIntrinsic => {}
+                    abi => { register_foreign_item_fn(ccx, abi, foreign_item); }
                 }
             }
             _ => {}
@@ -486,7 +486,7 @@ pub fn register_rust_fn_with_foreign_abi(ccx: &CrateContext,
     let t = ty::node_id_to_type(ccx.tcx(), node_id);
     let (cconv, output) = match ty::get(t).sty {
         ty::ty_bare_fn(ref fn_ty) => {
-            let c = llvm_calling_convention(ccx, fn_ty.abis);
+            let c = llvm_calling_convention(ccx, fn_ty.abi);
             (c.unwrap_or(lib::llvm::CCallConv), fn_ty.sig.output)
         }
         _ => fail!("expected bare fn in register_rust_fn_with_foreign_abi")
@@ -534,7 +534,7 @@ fn build_rust_fn(ccx: &CrateContext,
         // normal Rust function. This will be the type of the wrappee fn.
         let f = match ty::get(t).sty {
             ty::ty_bare_fn(ref f) => {
-                assert!(!f.abis.is_rust() && !f.abis.is_intrinsic());
+                assert!(f.abi != Rust && f.abi != RustIntrinsic);
                 f
             }
             _ => {
index 3d4a33c217d813daffb748e491f1535a8a55f1fd..851f8207cb68b79647cda2c2e10214586198ca71 100644 (file)
@@ -34,6 +34,7 @@
 use util::ppaux::Repr;
 
 use std::c_str::ToCStr;
+use syntax::abi::Rust;
 use syntax::parse::token;
 use syntax::{ast, ast_map, visit};
 
@@ -74,22 +75,6 @@ pub fn trans_impl(ccx: &CrateContext,
     }
 }
 
-/// Translates a (possibly monomorphized) method body.
-///
-/// Parameters:
-/// * `method`: the AST node for the method
-/// * `param_substs`: if this is a generic method, the current values for
-///   type parameters and so forth, else None
-/// * `llfn`: the LLVM ValueRef for the method
-///
-pub fn trans_method(ccx: &CrateContext, method: &ast::Method,
-                    param_substs: Option<@param_substs>,
-                    llfn: ValueRef) -> ValueRef {
-    trans_fn(ccx, method.decl, method.body,
-             llfn, param_substs, method.id, []);
-    llfn
-}
-
 pub fn trans_method_callee<'a>(
                            bcx: &'a Block<'a>,
                            method_call: MethodCall,
@@ -409,7 +394,7 @@ pub fn trans_trait_callee_from_llval<'a>(bcx: &'a Block<'a>,
     debug!("(translating trait callee) loading method");
     // Replace the self type (&Self or ~Self) with an opaque pointer.
     let llcallee_ty = match ty::get(callee_ty).sty {
-        ty::ty_bare_fn(ref f) if f.abis.is_rust() => {
+        ty::ty_bare_fn(ref f) if f.abi == Rust => {
             type_of_rust_fn(ccx, true, f.sig.inputs.slice_from(1), f.sig.output)
         }
         _ => {
index 179fda7cc4673978a45e2570a92ec13856df2fa4..6f2dbc182b04f3000852d8196b3af4cbbef87bd5 100644 (file)
@@ -23,6 +23,7 @@
 use middle::typeck;
 use util::ppaux::Repr;
 
+use syntax::abi;
 use syntax::ast;
 use syntax::ast_map;
 use syntax::ast_util::local_def;
@@ -99,7 +100,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
 
     match map_node {
         ast_map::NodeForeignItem(_) => {
-            if !ccx.tcx.map.get_foreign_abis(fn_id.node).is_intrinsic() {
+            if ccx.tcx.map.get_foreign_abi(fn_id.node) != abi::RustIntrinsic {
                 // Foreign externs don't have to be monomorphized.
                 return (get_item_val(ccx, fn_id.node), true);
             }
@@ -150,7 +151,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
 
     let f = match ty::get(mono_ty).sty {
         ty::ty_bare_fn(ref f) => {
-            assert!(f.abis.is_rust() || f.abis.is_intrinsic());
+            assert!(f.abi == abi::Rust || f.abi == abi::RustIntrinsic);
             f
         }
         _ => fail!("expected bare rust fn or an intrinsic")
index 7218375563342109c5e292f8b8f217c9a8e6f863..e73ef639a0ba86bec68f32eb78aeab28f1e83bc1 100644 (file)
@@ -46,10 +46,6 @@ pub fn c_uint(&mut self, u: uint) -> ValueRef {
         C_uint(self.bcx.ccx(), u)
     }
 
-    pub fn c_int(&mut self, i: int) -> ValueRef {
-        C_int(self.bcx.ccx(), i)
-    }
-
     pub fn c_bool(&mut self, b: bool) -> ValueRef {
         C_bool(self.bcx.ccx(), b)
     }
index a0700aa5840b74867a07f17a155579a657362545..96368467163cd55a1632b02706d096de846880fb 100644 (file)
@@ -55,14 +55,6 @@ pub fn get_fill(bcx: &Block, vptr: ValueRef) -> ValueRef {
     Load(bcx, GEPi(bcx, vptr, [0u, abi::vec_elt_fill]))
 }
 
-pub fn set_fill(bcx: &Block, vptr: ValueRef, fill: ValueRef) {
-    Store(bcx, fill, GEPi(bcx, vptr, [0u, abi::vec_elt_fill]));
-}
-
-pub fn get_alloc(bcx: &Block, vptr: ValueRef) -> ValueRef {
-    Load(bcx, GEPi(bcx, vptr, [0u, abi::vec_elt_alloc]))
-}
-
 pub fn get_dataptr(bcx: &Block, vptr: ValueRef) -> ValueRef {
     let _icx = push_ctxt("tvec::get_dataptr");
     GEPi(bcx, vptr, [0u, abi::vec_elt_elems, 0u])
@@ -102,15 +94,6 @@ pub fn alloc_raw<'a>(
     }
 }
 
-pub fn alloc_uniq_raw<'a>(
-                      bcx: &'a Block<'a>,
-                      unit_ty: ty::t,
-                      fill: ValueRef,
-                      alloc: ValueRef)
-                      -> Result<'a> {
-    alloc_raw(bcx, unit_ty, fill, alloc, heap_exchange)
-}
-
 pub fn alloc_uniq_vec<'a>(
                  bcx: &'a Block<'a>,
                  unit_ty: ty::t,
@@ -693,19 +676,6 @@ pub fn iter_vec_raw<'r,
     }
 }
 
-pub fn iter_vec_uniq<'r,
-                     'b>(
-                     bcx: &'b Block<'b>,
-                     vptr: ValueRef,
-                     vec_ty: ty::t,
-                     fill: ValueRef,
-                     f: iter_vec_block<'r,'b>)
-                     -> &'b Block<'b> {
-    let _icx = push_ctxt("tvec::iter_vec_uniq");
-    let data_ptr = get_dataptr(bcx, vptr);
-    iter_vec_raw(bcx, data_ptr, vec_ty, fill, f)
-}
-
 pub fn iter_vec_unboxed<'r,
                         'b>(
                         bcx: &'b Block<'b>,
index ca01c0532fc39f1cac3d73bdd7d10ce168886aba..55ffa951cf2d7f62b45d81d50db571c9e2a914b4 100644 (file)
@@ -20,7 +20,6 @@
 
 use std::c_str::ToCStr;
 use std::cast;
-use std::slice;
 
 use std::libc::{c_uint};
 
@@ -135,10 +134,6 @@ pub fn float_from_ty(ccx: &CrateContext, t: ast::FloatTy) -> Type {
         }
     }
 
-    pub fn size_t(ccx: &CrateContext) -> Type {
-        Type::int(ccx)
-    }
-
     pub fn func(args: &[Type], ret: &Type) -> Type {
         let vec : &[TypeRef] = unsafe { cast::transmute(args) };
         ty!(llvm::LLVMFunctionType(ret.to_ref(), vec.as_ptr(),
@@ -151,10 +146,6 @@ pub fn variadic_func(args: &[Type], ret: &Type) -> Type {
                                    args.len() as c_uint, True))
     }
 
-    pub fn ptr(ty: Type) -> Type {
-        ty!(llvm::LLVMPointerType(ty.to_ref(), 0 as c_uint))
-    }
-
     pub fn struct_(ccx: &CrateContext, els: &[Type], packed: bool) -> Type {
         let els : &[TypeRef] = unsafe { cast::transmute(els) };
         ty!(llvm::LLVMStructTypeInContext(ccx.llcx, els.as_ptr(),
@@ -259,17 +250,6 @@ pub fn ptr_to(&self) -> Type {
         ty!(llvm::LLVMPointerType(self.to_ref(), 0))
     }
 
-    pub fn get_field(&self, idx: uint) -> Type {
-        unsafe {
-            let num_fields = llvm::LLVMCountStructElementTypes(self.to_ref()) as uint;
-            let mut elems = slice::from_elem(num_fields, 0 as TypeRef);
-
-            llvm::LLVMGetStructElementTypes(self.to_ref(), elems.as_mut_ptr());
-
-            Type::from_ref(elems[idx])
-        }
-    }
-
     pub fn is_packed(&self) -> bool {
         unsafe {
             llvm::LLVMIsPackedStruct(self.to_ref()) == True
index a78520c8f6bfd7ab86d9e96a50aefc14f4e8daec..f45ef45720483deb273d75be39d8e8e3a2bbf59b 100644 (file)
@@ -19,6 +19,7 @@
 
 use middle::trans::type_::Type;
 
+use syntax::abi;
 use syntax::ast;
 use syntax::owned_slice::OwnedSlice;
 
@@ -75,7 +76,7 @@ pub fn type_of_fn_from_ty(cx: &CrateContext, fty: ty::t) -> Type {
             type_of_rust_fn(cx, true, f.sig.inputs.as_slice(), f.sig.output)
         }
         ty::ty_bare_fn(ref f) => {
-            if f.abis.is_rust() || f.abis.is_intrinsic() {
+            if f.abi == abi::Rust || f.abi == abi::RustIntrinsic {
                 type_of_rust_fn(cx,
                                 false,
                                 f.sig.inputs.as_slice(),
index f66a393a50f9d98c48b8323897aadafcff26a0b6..1efb47ad42fb5bc0daa36bf80d640e90b1aca651 100644 (file)
@@ -13,7 +13,7 @@
 use middle::trans::common::Block;
 use std::libc::c_uint;
 
-pub struct Value(ValueRef);
+pub struct Value(pub ValueRef);
 
 macro_rules! opt_val ( ($e:expr) => (
     unsafe {
index 176ed409dd49f6bfb8082600277f542c3c2b7f81..4aefa3b9edcccb1643e07374f4f1514efd7c333d 100644 (file)
@@ -51,7 +51,7 @@
 use syntax::parse::token::InternedString;
 use syntax::{ast, ast_map};
 use syntax::owned_slice::OwnedSlice;
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax;
 use collections::enum_set::{EnumSet, CLike};
 
@@ -411,16 +411,13 @@ pub fn type_has_self(t: t) -> bool { tbox_has_flag(get(t), has_self) }
 pub fn type_needs_infer(t: t) -> bool {
     tbox_has_flag(get(t), needs_infer)
 }
-pub fn type_has_regions(t: t) -> bool {
-    tbox_has_flag(get(t), has_regions)
-}
 pub fn type_id(t: t) -> uint { get(t).id }
 
 #[deriving(Clone, Eq, TotalEq, Hash)]
 pub struct BareFnTy {
     pub purity: ast::Purity,
-    pub abis: AbiSet,
-    pub sig: FnSig
+    pub abi: abi::Abi,
+    pub sig: FnSig,
 }
 
 #[deriving(Clone, Eq, TotalEq, Hash)]
@@ -799,7 +796,7 @@ pub enum type_err {
     terr_mismatch,
     terr_purity_mismatch(expected_found<Purity>),
     terr_onceness_mismatch(expected_found<Onceness>),
-    terr_abi_mismatch(expected_found<AbiSet>),
+    terr_abi_mismatch(expected_found<abi::Abi>),
     terr_mutability,
     terr_sigil_mismatch(expected_found<ast::Sigil>),
     terr_box_mutability,
@@ -869,13 +866,13 @@ fn from_uint(v: uint) -> BuiltinBound {
 }
 
 #[deriving(Clone, Eq, TotalEq, Hash)]
-pub struct TyVid(uint);
+pub struct TyVid(pub uint);
 
 #[deriving(Clone, Eq, TotalEq, Hash)]
-pub struct IntVid(uint);
+pub struct IntVid(pub uint);
 
 #[deriving(Clone, Eq, TotalEq, Hash)]
-pub struct FloatVid(uint);
+pub struct FloatVid(pub uint);
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct RegionVid {
@@ -1412,7 +1409,7 @@ pub fn mk_ctor_fn(cx: &ctxt,
     mk_bare_fn(cx,
                BareFnTy {
                    purity: ast::ImpureFn,
-                   abis: AbiSet::Rust(),
+                   abi: abi::Rust,
                    sig: FnSig {
                     binder_id: binder_id,
                     inputs: input_args,
@@ -1506,10 +1503,6 @@ pub fn walk_regions_and_ty(cx: &ctxt, ty: t, fldr: |r: Region|, fldt: |t: t|)
                                    |t| { fldt(t); t }).fold_ty(ty)
 }
 
-pub fn fold_regions(cx: &ctxt, ty: t, fldr: |r: Region| -> Region) -> t {
-    ty_fold::RegionFolder::regions(cx, fldr).fold_ty(ty)
-}
-
 // Substitute *only* type parameters.  Used in trans where regions are erased.
 pub fn subst_tps(tcx: &ctxt, tps: &[t], self_ty_opt: Option<t>, typ: t) -> t {
     let mut subst = TpsSubst { tcx: tcx, self_ty_opt: self_ty_opt, tps: tps };
@@ -1623,13 +1616,6 @@ pub fn type_is_structural(ty: t) -> bool {
     }
 }
 
-pub fn type_is_sequence(ty: t) -> bool {
-    match get(ty).sty {
-      ty_str(_) | ty_vec(_, _) => true,
-      _ => false
-    }
-}
-
 pub fn type_is_simd(cx: &ctxt, ty: t) -> bool {
     match get(ty).sty {
         ty_struct(did, _) => lookup_simd(cx, did),
@@ -1637,13 +1623,6 @@ pub fn type_is_simd(cx: &ctxt, ty: t) -> bool {
     }
 }
 
-pub fn type_is_str(ty: t) -> bool {
-    match get(ty).sty {
-      ty_str(_) => true,
-      _ => false
-    }
-}
-
 pub fn sequence_element_type(cx: &ctxt, ty: t) -> t {
     match get(ty).sty {
       ty_str(_) => return mk_mach_uint(ast::TyU8),
@@ -1672,20 +1651,6 @@ pub fn simd_size(cx: &ctxt, ty: t) -> uint {
     }
 }
 
-pub fn get_element_type(ty: t, i: uint) -> t {
-    match get(ty).sty {
-      ty_tup(ref ts) => return *ts.get(i),
-      _ => fail!("get_element_type called on invalid type")
-    }
-}
-
-pub fn type_is_box(ty: t) -> bool {
-    match get(ty).sty {
-      ty_box(_) => return true,
-      _ => return false
-    }
-}
-
 pub fn type_is_boxed(ty: t) -> bool {
     match get(ty).sty {
       ty_box(_) => true,
@@ -1700,20 +1665,6 @@ pub fn type_is_region_ptr(ty: t) -> bool {
     }
 }
 
-pub fn type_is_slice(ty: t) -> bool {
-    match get(ty).sty {
-      ty_vec(_, vstore_slice(_)) | ty_str(vstore_slice(_)) => true,
-      _ => return false
-    }
-}
-
-pub fn type_is_unique_box(ty: t) -> bool {
-    match get(ty).sty {
-      ty_uniq(_) => return true,
-      _ => return false
-    }
-}
-
 pub fn type_is_unsafe_ptr(ty: t) -> bool {
     match get(ty).sty {
       ty_ptr(_) => return true,
@@ -1721,14 +1672,6 @@ pub fn type_is_unsafe_ptr(ty: t) -> bool {
     }
 }
 
-pub fn type_is_vec(ty: t) -> bool {
-    return match get(ty).sty {
-          ty_vec(_, _) | ty_unboxed_vec(_) => true,
-          ty_str(_) => true,
-          _ => false
-        };
-}
-
 pub fn type_is_unique(ty: t) -> bool {
     match get(ty).sty {
         ty_uniq(_) | ty_vec(_, vstore_uniq) | ty_str(vstore_uniq) => true,
@@ -1920,10 +1863,6 @@ mod TC {
 )
 
 impl TypeContents {
-    pub fn meets_bounds(&self, cx: &ctxt, bbs: BuiltinBounds) -> bool {
-        bbs.iter().all(|bb| self.meets_bound(cx, bb))
-    }
-
     pub fn meets_bound(&self, cx: &ctxt, bb: BuiltinBound) -> bool {
         match bb {
             BoundStatic => self.is_static(cx),
@@ -2021,10 +1960,6 @@ pub fn union<T>(v: &[T], f: |&T| -> TypeContents) -> TypeContents {
         v.iter().fold(TC::None, |tc, t| tc | f(t))
     }
 
-    pub fn inverse(&self) -> TypeContents {
-        TypeContents { bits: !self.bits }
-    }
-
     pub fn has_dtor(&self) -> bool {
         self.intersects(TC::OwnsDtor)
     }
@@ -2054,10 +1989,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-pub fn type_has_dtor(cx: &ctxt, t: ty::t) -> bool {
-    type_contents(cx, t).has_dtor()
-}
-
 pub fn type_is_static(cx: &ctxt, t: ty::t) -> bool {
     type_contents(cx, t).is_static(cx)
 }
@@ -2649,14 +2580,8 @@ pub fn type_is_machine(ty: t) -> bool {
     }
 }
 
-pub fn type_is_enum(ty: t) -> bool {
-    match get(ty).sty {
-      ty_enum(_, _) => return true,
-      _ => return false
-    }
-}
-
 // Is the type's representation size known at compile time?
+#[allow(dead_code)] // leaving in for DST
 pub fn type_is_sized(cx: &ctxt, ty: ty::t) -> bool {
     match get(ty).sty {
         // FIXME(#6308) add trait, vec, str, etc here.
@@ -2688,14 +2613,6 @@ pub fn type_is_c_like_enum(cx: &ctxt, ty: t) -> bool {
     }
 }
 
-pub fn type_param(ty: t) -> Option<uint> {
-    match get(ty).sty {
-      ty_param(p) => return Some(p.idx),
-      _ => {/* fall through */ }
-    }
-    return None;
-}
-
 // Returns the type and mutability of *t.
 //
 // The parameter `explicit` indicates if this is an *explicit* dereference.
@@ -2758,10 +2675,6 @@ pub fn node_id_to_type_params(cx: &ctxt, id: ast::NodeId) -> Vec<t> {
     }
 }
 
-fn node_id_has_type_params(cx: &ctxt, id: ast::NodeId) -> bool {
-    cx.node_type_substs.borrow().contains_key(&id)
-}
-
 pub fn fn_is_variadic(fty: t) -> bool {
     match get(fty).sty {
         ty_bare_fn(ref f) => f.sig.variadic,
@@ -2802,16 +2715,6 @@ pub fn ty_closure_sigil(fty: t) -> Sigil {
     }
 }
 
-pub fn ty_fn_purity(fty: t) -> ast::Purity {
-    match get(fty).sty {
-        ty_bare_fn(ref f) => f.purity,
-        ty_closure(ref f) => f.purity,
-        ref s => {
-            fail!("ty_fn_purity() called on non-fn type: {:?}", s)
-        }
-    }
-}
-
 pub fn ty_fn_ret(fty: t) -> t {
     match get(fty).sty {
         ty_bare_fn(ref f) => f.sig.output,
@@ -2830,14 +2733,6 @@ pub fn is_fn_ty(fty: t) -> bool {
     }
 }
 
-pub fn ty_vstore(ty: t) -> vstore {
-    match get(ty).sty {
-        ty_vec(_, vstore) => vstore,
-        ty_str(vstore) => vstore,
-        ref s => fail!("ty_vstore() called on invalid sty: {:?}", s)
-    }
-}
-
 pub fn ty_region(tcx: &ctxt,
                  span: Span,
                  ty: t) -> Region {
@@ -2853,49 +2748,6 @@ pub fn ty_region(tcx: &ctxt,
     }
 }
 
-pub fn replace_fn_sig(cx: &ctxt, fsty: &sty, new_sig: FnSig) -> t {
-    match *fsty {
-        ty_bare_fn(ref f) => mk_bare_fn(cx, BareFnTy {sig: new_sig, ..*f}),
-        ty_closure(ref f) => mk_closure(cx, ClosureTy {sig: new_sig, ..**f}),
-        ref s => {
-            cx.sess.bug(
-                format!("ty_fn_sig() called on non-fn type: {:?}", s));
-        }
-    }
-}
-
-pub fn replace_closure_return_type(tcx: &ctxt, fn_type: t, ret_type: t) -> t {
-    /*!
-     *
-     * Returns a new function type based on `fn_type` but returning a value of
-     * type `ret_type` instead. */
-
-    match ty::get(fn_type).sty {
-        ty::ty_closure(ref fty) => {
-            ty::mk_closure(tcx, ClosureTy {
-                sig: FnSig {output: ret_type, ..fty.sig.clone()},
-                ..(**fty).clone()
-            })
-        }
-        _ => {
-            tcx.sess.bug(format!(
-                "replace_fn_ret() invoked with non-fn-type: {}",
-                ty_to_str(tcx, fn_type)));
-        }
-    }
-}
-
-// Returns a vec of all the input and output types of fty.
-pub fn tys_in_fn_sig(sig: &FnSig) -> Vec<t> {
-    sig.inputs.iter().map(|a| *a).collect::<Vec<_>>().append_one(sig.output)
-}
-
-// Type accessors for AST nodes
-pub fn block_ty(cx: &ctxt, b: &ast::Block) -> t {
-    return node_id_to_type(cx, b.id);
-}
-
-
 // Returns the type of a pattern as a monotype. Like @expr_ty, this function
 // doesn't provide type parameter substitutions.
 pub fn pat_ty(cx: &ctxt, pat: &ast::Pat) -> t {
@@ -3187,6 +3039,7 @@ pub struct ParamsTy {
     pub ty: t
 }
 
+#[allow(dead_code)] // this may be useful?
 pub fn expr_ty_params_and_ty(cx: &ctxt,
                              expr: &ast::Expr)
                           -> ParamsTy {
@@ -3196,10 +3049,6 @@ pub fn expr_ty_params_and_ty(cx: &ctxt,
     }
 }
 
-pub fn expr_has_ty_params(cx: &ctxt, expr: &ast::Expr) -> bool {
-    return node_id_has_type_params(cx, expr.id);
-}
-
 pub fn method_call_type_param_defs(tcx: &ctxt, origin: typeck::MethodOrigin)
                                    -> Rc<Vec<TypeParameterDef>> {
     match origin {
@@ -3423,12 +3272,6 @@ pub fn stmt_node_id(s: &ast::Stmt) -> ast::NodeId {
     }
 }
 
-pub fn field_idx(name: ast::Name, fields: &[field]) -> Option<uint> {
-    let mut i = 0u;
-    for f in fields.iter() { if f.ident.name == name { return Some(i); } i += 1u; }
-    return None;
-}
-
 pub fn field_idx_strict(tcx: &ctxt, name: ast::Name, fields: &[field])
                      -> uint {
     let mut i = 0u;
@@ -3664,14 +3507,6 @@ pub fn note_and_explain_type_err(cx: &ctxt, err: &type_err) {
     }
 }
 
-pub fn def_has_ty_params(def: ast::Def) -> bool {
-    match def {
-      ast::DefFn(_, _) | ast::DefVariant(_, _, _) | ast::DefStruct(_)
-        => true,
-      _ => false
-    }
-}
-
 pub fn provided_source(cx: &ctxt, id: ast::DefId) -> Option<ast::DefId> {
     cx.provided_method_sources.borrow().find(&id).map(|x| *x)
 }
@@ -3850,8 +3685,8 @@ pub fn try_add_builtin_trait(tcx: &ctxt,
 
 pub fn ty_to_def_id(ty: t) -> Option<ast::DefId> {
     match get(ty).sty {
-      ty_trait(~TyTrait { def_id: id, .. }) | ty_struct(id, _) | ty_enum(id, _) => Some(id),
-      _ => None
+        ty_trait(~TyTrait { def_id: id, .. }) | ty_struct(id, _) | ty_enum(id, _) => Some(id),
+        _ => None
     }
 }
 
@@ -4247,18 +4082,6 @@ pub fn lookup_struct_fields(cx: &ctxt, did: ast::DefId) -> Vec<field_ty> {
     }
 }
 
-pub fn lookup_struct_field(cx: &ctxt,
-                           parent: ast::DefId,
-                           field_id: ast::DefId)
-                        -> field_ty {
-    let r = lookup_struct_fields(cx, parent);
-    match r.iter().find(
-                 |f| f.id.node == field_id.node) {
-        Some(t) => *t,
-        None => cx.sess.bug("struct ID not found in parent's fields")
-    }
-}
-
 fn struct_field_tys(fields: &[StructField]) -> Vec<field_ty> {
     fields.iter().map(|field| {
         match field.node.kind {
@@ -4368,13 +4191,6 @@ fn tycat(cx: &ctxt, ty: t) -> int {
     return tbl[tycat(cx, ty) as uint ][opcat(op) as uint];
 }
 
-pub fn ty_params_to_tys(tcx: &ctxt, generics: &ast::Generics) -> Vec<t> {
-    Vec::from_fn(generics.ty_params.len(), |i| {
-        let id = generics.ty_params.get(i).id;
-        ty::mk_param(tcx, i, ast_util::local_def(id))
-    })
-}
-
 /// Returns an equivalent type with all the typedefs and self regions removed.
 pub fn normalize_ty(cx: &ctxt, t: t) -> t {
     let u = TypeNormalizer(cx).fold_ty(t);
@@ -4554,19 +4370,6 @@ pub fn each_bound_trait_and_supertraits(tcx: &ctxt,
     return true;
 }
 
-pub fn count_traits_and_supertraits(tcx: &ctxt,
-                                    type_param_defs: &[TypeParameterDef]) -> uint {
-    let mut total = 0;
-    for type_param_def in type_param_defs.iter() {
-        each_bound_trait_and_supertraits(
-            tcx, type_param_def.bounds.trait_bounds.as_slice(), |_| {
-            total += 1;
-            true
-        });
-    }
-    return total;
-}
-
 pub fn get_tydesc_ty(tcx: &ctxt) -> Result<t, ~str> {
     tcx.lang_items.require(TyDescStructLangItem).map(|tydesc_lang_item| {
         tcx.intrinsic_defs.borrow().find_copy(&tydesc_lang_item)
@@ -4874,7 +4677,7 @@ pub fn hash_crate_independent(tcx: &ctxt, t: t, svh: &Svh) -> u64 {
             ty_bare_fn(ref b) => {
                 byte!(14);
                 hash!(b.purity);
-                hash!(b.abis);
+                hash!(b.abi);
             }
             ty_closure(ref c) => {
                 byte!(15);
@@ -5050,12 +4853,4 @@ pub fn to_user_str(&self) -> &'static str {
             UniqueImmBorrow => "uniquely immutable",
         }
     }
-
-    pub fn to_short_str(&self) -> &'static str {
-        match *self {
-            MutBorrow => "mut",
-            ImmBorrow => "imm",
-            UniqueImmBorrow => "own",
-        }
-    }
 }
index 7eae2ce3d336461337e8a027f829e3f50d267e2c..02c4ffe68c1ee3f1c8e241a158c77d7529f29249 100644 (file)
@@ -48,7 +48,7 @@ fn fold_bare_fn_ty(&mut self,
                        fty: &ty::BareFnTy)
                        -> ty::BareFnTy {
         ty::BareFnTy { sig: self.fold_sig(&fty.sig),
-                       abis: fty.abis,
+                       abi: fty.abi,
                        purity: fty.purity }
     }
 
index 5d2d221a774e013ba5e50e72332019c614cb8180..82be783616888aec3e1cdbba8f7d45eb412dbcbb 100644 (file)
@@ -60,7 +60,7 @@
 use middle::typeck::lookup_def_tcx;
 use util::ppaux::Repr;
 
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::{ast, ast_util};
 use syntax::codemap::Span;
 use syntax::owned_slice::OwnedSlice;
@@ -519,12 +519,12 @@ fn mk_pointer<AC:AstConv,
                 ty::mk_tup(tcx, flds)
             }
             ast::TyBareFn(ref bf) => {
-                if bf.decl.variadic && !bf.abis.is_c() {
+                if bf.decl.variadic && bf.abi != abi::C {
                     tcx.sess.span_err(ast_ty.span,
                                       "variadic function must have C calling convention");
                 }
                 ty::mk_bare_fn(tcx, ty_of_bare_fn(this, ast_ty.id, bf.purity,
-                                                  bf.abis, bf.decl))
+                                                  bf.abi, bf.decl))
             }
             ast::TyClosure(ref f) => {
                 if f.sigil == ast::ManagedSigil {
@@ -666,20 +666,20 @@ pub fn ty_of_method<AC:AstConv>(
     untransformed_self_ty: ty::t,
     explicit_self: ast::ExplicitSelf,
     decl: &ast::FnDecl) -> ty::BareFnTy {
-    ty_of_method_or_bare_fn(this, id, purity, AbiSet::Rust(), Some(SelfInfo {
+    ty_of_method_or_bare_fn(this, id, purity, abi::Rust, Some(SelfInfo {
         untransformed_self_ty: untransformed_self_ty,
         explicit_self: explicit_self
     }), decl)
 }
 
 pub fn ty_of_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
-                                 purity: ast::Purity, abi: AbiSet,
+                                 purity: ast::Purity, abi: abi::Abi,
                                  decl: &ast::FnDecl) -> ty::BareFnTy {
     ty_of_method_or_bare_fn(this, id, purity, abi, None, decl)
 }
 
 fn ty_of_method_or_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
-                                       purity: ast::Purity, abi: AbiSet,
+                                       purity: ast::Purity, abi: abi::Abi,
                                        opt_self_info: Option<SelfInfo>,
                                        decl: &ast::FnDecl) -> ty::BareFnTy {
     debug!("ty_of_method_or_bare_fn");
@@ -726,7 +726,7 @@ fn ty_of_method_or_bare_fn<AC:AstConv>(this: &AC, id: ast::NodeId,
 
     return ty::BareFnTy {
         purity: purity,
-        abis: abi,
+        abi: abi,
         sig: ty::FnSig {
             binder_id: id,
             inputs: self_and_input_tys,
index 07ebcf7ee9406e843cdaff5c46eaf4668e4a7038..dce4e7fb06b94f627a3e9e8b8a59e050040ba306 100644 (file)
@@ -1164,7 +1164,7 @@ fn confirm_candidate(&self, rcvr_ty: ty::t, candidate: &Candidate)
         let fty = ty::mk_bare_fn(tcx, ty::BareFnTy {
             sig: fn_sig,
             purity: bare_fn_ty.purity,
-            abis: bare_fn_ty.abis.clone(),
+            abi: bare_fn_ty.abi.clone(),
         });
         debug!("after replacing bound regions, fty={}", self.ty_to_str(fty));
 
index 4cf3cc51cc1b64116bb6aafdcb1179f7e421cc5c..20ab2b699c2b6525eca9f30ea34c5b1212fcd84e 100644 (file)
 use std::result;
 use std::slice;
 use std::vec::Vec;
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::ast::{Provided, Required};
 use syntax::ast;
 use syntax::ast_util::local_def;
@@ -510,27 +510,6 @@ fn check_fn<'a>(ccx: &'a CrateCtxt<'a>,
     fcx
 }
 
-pub fn check_no_duplicate_fields(tcx: &ty::ctxt,
-                                 fields: Vec<(ast::Ident, Span)>) {
-    let mut field_names = HashMap::new();
-
-    for p in fields.iter() {
-        let (id, sp) = *p;
-        let orig_sp = field_names.find(&id).map(|x| *x);
-        match orig_sp {
-            Some(orig_sp) => {
-                tcx.sess.span_err(sp, format!("duplicate field name {} in record type declaration",
-                                              token::get_ident(id)));
-                tcx.sess.span_note(orig_sp, "first declaration of this field occurred here");
-                break;
-            }
-            None => {
-                field_names.insert(id, sp);
-            }
-        }
-    }
-}
-
 pub fn check_struct(ccx: &CrateCtxt, id: ast::NodeId, span: Span) {
     let tcx = ccx.tcx;
 
@@ -620,7 +599,7 @@ pub fn check_item(ccx: &CrateCtxt, it: &ast::Item) {
         check_bounds_are_used(ccx, t.span, &generics.ty_params, tpt_ty);
       }
       ast::ItemForeignMod(ref m) => {
-        if m.abis.is_intrinsic() {
+        if m.abi == abi::RustIntrinsic {
             for item in m.items.iter() {
                 check_intrinsic_type(ccx, *item);
             }
@@ -633,7 +612,7 @@ pub fn check_item(ccx: &CrateCtxt, it: &ast::Item) {
 
                 match item.node {
                     ast::ForeignItemFn(ref fn_decl, _) => {
-                        if fn_decl.variadic && !m.abis.is_c() {
+                        if fn_decl.variadic && m.abi != abi::C {
                             ccx.tcx.sess.span_err(
                                 item.span, "variadic function must have C calling convention");
                         }
@@ -1010,10 +989,6 @@ pub fn local_ty(&self, span: Span, nid: ast::NodeId) -> ty::t {
         }
     }
 
-    pub fn block_region(&self) -> ty::Region {
-        ty::ReScope(self.region_lb.get())
-    }
-
     #[inline]
     pub fn write_ty(&self, node_id: ast::NodeId, ty: ty::t) {
         debug!("write_ty({}, {}) in fcx {}",
@@ -1100,18 +1075,6 @@ pub fn node_ty(&self, id: ast::NodeId) -> ty::t {
         }
     }
 
-    pub fn node_ty_substs(&self, id: ast::NodeId) -> ty::substs {
-        match self.inh.node_type_substs.borrow().find(&id) {
-            Some(ts) => (*ts).clone(),
-            None => {
-                self.tcx().sess.bug(
-                    format!("no type substs for node {}: {} in fcx {}",
-                            id, self.tcx().map.node_to_str(id),
-                            self.tag()));
-            }
-        }
-    }
-
     pub fn method_ty_substs(&self, id: ast::NodeId) -> ty::substs {
         match self.inh.method_map.borrow().find(&MethodCall::expr(id)) {
             Some(method) => method.substs.clone(),
@@ -1167,11 +1130,6 @@ pub fn mk_assignty(&self,
         }
     }
 
-    pub fn can_mk_assignty(&self, sub: ty::t, sup: ty::t)
-                           -> Result<(), ty::type_err> {
-        infer::can_mk_coercety(self.infcx(), sub, sup)
-    }
-
     pub fn mk_eqty(&self,
                    a_is_expected: bool,
                    origin: infer::TypeOrigin,
@@ -3309,10 +3267,6 @@ pub fn check_block_no_value(fcx: &FnCtxt, blk: &ast::Block)  {
     }
 }
 
-pub fn check_block(fcx0: &FnCtxt, blk: &ast::Block)  {
-    check_block_with_expected(fcx0, blk, None)
-}
-
 pub fn check_block_with_expected(fcx: &FnCtxt,
                                  blk: &ast::Block,
                                  expected: Option<ty::t>) {
@@ -4270,7 +4224,7 @@ fn param(ccx: &CrateCtxt, n: uint) -> ty::t {
     };
     let fty = ty::mk_bare_fn(tcx, ty::BareFnTy {
         purity: ast::UnsafeFn,
-        abis: AbiSet::Intrinsic(),
+        abi: abi::RustIntrinsic,
         sig: FnSig {binder_id: it.id,
                     inputs: inputs,
                     output: output,
index ca7706153958347f84270ac58746a12419215692..274f88ad4c37d919bd4d6426ac4fd6cbc29b682d 100644 (file)
@@ -48,7 +48,7 @@
 use std::rc::Rc;
 use collections::HashSet;
 
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::ast::{RegionTyParamBound, TraitTyParamBound};
 use syntax::ast;
 use syntax::ast_map;
@@ -116,8 +116,8 @@ fn get_item_ty(&self, id: ast::DefId) -> ty::ty_param_bounds_and_ty {
         match self.tcx.map.find(id.node) {
             Some(ast_map::NodeItem(item)) => ty_of_item(self, item),
             Some(ast_map::NodeForeignItem(foreign_item)) => {
-                let abis = self.tcx.map.get_foreign_abis(id.node);
-                ty_of_foreign_item(self, foreign_item, abis)
+                let abi = self.tcx.map.get_foreign_abi(id.node);
+                ty_of_foreign_item(self, foreign_item, abi)
             }
             x => {
                 self.tcx.sess.bug(format!("unexpected sort of node \
@@ -550,10 +550,10 @@ pub fn ensure_no_ty_param_bounds(ccx: &CrateCtxt,
 
 fn ensure_generics_abi(ccx: &CrateCtxt,
                        span: Span,
-                       abis: AbiSet,
+                       abi: abi::Abi,
                        generics: &ast::Generics) {
     if generics.ty_params.len() > 0 &&
-       !(abis.is_rust() || abis.is_intrinsic()) {
+       !(abi == abi::Rust || abi == abi::RustIntrinsic) {
         ccx.tcx.sess.span_err(span,
                               "foreign functions may not use type parameters");
     }
@@ -717,9 +717,9 @@ pub fn convert_foreign(ccx: &CrateCtxt, i: &ast::ForeignItem) {
     // map, and I regard each time that I use it as a personal and
     // moral failing, but at the moment it seems like the only
     // convenient way to extract the ABI. - ndm
-    let abis = ccx.tcx.map.get_foreign_abis(i.id);
+    let abi = ccx.tcx.map.get_foreign_abi(i.id);
 
-    let tpt = ty_of_foreign_item(ccx, i, abis);
+    let tpt = ty_of_foreign_item(ccx, i, abi);
     write_ty_to_tcx(ccx.tcx, i.id, tpt.ty);
 
     ccx.tcx.tcache.borrow_mut().insert(local_def(i.id), tpt);
@@ -891,7 +891,7 @@ pub fn ty_of_item(ccx: &CrateCtxt, it: &ast::Item)
 
 pub fn ty_of_foreign_item(ccx: &CrateCtxt,
                           it: &ast::ForeignItem,
-                          abis: AbiSet) -> ty::ty_param_bounds_and_ty
+                          abi: abi::Abi) -> ty::ty_param_bounds_and_ty
 {
     match it.node {
         ast::ForeignItemFn(fn_decl, ref generics) => {
@@ -899,7 +899,7 @@ pub fn ty_of_foreign_item(ccx: &CrateCtxt,
                                   fn_decl,
                                   local_def(it.id),
                                   generics,
-                                  abis)
+                                  abi)
         }
         ast::ForeignItemStatic(t, _) => {
             ty::ty_param_bounds_and_ty {
@@ -1003,7 +1003,7 @@ pub fn ty_of_foreign_fn_decl(ccx: &CrateCtxt,
                              decl: &ast::FnDecl,
                              def_id: ast::DefId,
                              ast_generics: &ast::Generics,
-                             abis: AbiSet)
+                             abi: abi::Abi)
                           -> ty::ty_param_bounds_and_ty {
 
     for i in decl.inputs.iter() {
@@ -1028,7 +1028,7 @@ pub fn ty_of_foreign_fn_decl(ccx: &CrateCtxt,
     let t_fn = ty::mk_bare_fn(
         ccx.tcx,
         ty::BareFnTy {
-            abis: abis,
+            abi: abi,
             purity: ast::UnsafeFn,
             sig: ty::FnSig {binder_id: def_id.node,
                             inputs: input_tys,
index 5dc55ab4b5c07056084b91e5b0cbb60c73d48fa4..8a1662ca701d349273e4f12dda7ec6be6e0bbb10 100644 (file)
@@ -77,13 +77,14 @@ fn foo<A>(a: A, b: A) { ... }
 use middle::typeck::infer::resolve::try_resolve_tvar_shallow;
 use util::common::indenter;
 
+use syntax::abi;
 use syntax::ast::MutImmutable;
 use syntax::ast;
 
 // Note: Coerce is not actually a combiner, in that it does not
 // conform to the same interface, though it performs a similar
 // function.
-pub struct Coerce<'f>(CombineFields<'f>);
+pub struct Coerce<'f>(pub CombineFields<'f>);
 
 impl<'f> Coerce<'f> {
     pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> {
@@ -384,7 +385,7 @@ fn coerce_from_bare_fn(&self, a: ty::t, fn_ty_a: &ty::BareFnTy, b: ty::t)
             debug!("coerce_from_bare_fn(a={}, b={})",
                    a.inf_str(self.get_ref().infcx), b.inf_str(self.get_ref().infcx));
 
-            if !fn_ty_a.abis.is_rust() || fn_ty_a.purity != ast::ImpureFn {
+            if fn_ty_a.abi != abi::Rust || fn_ty_a.purity != ast::ImpureFn {
                 return self.subtype(a, b);
             }
 
index af84e915f70403d4d4901903a0020065ac2b39ba..749c1ee69387c886acbf160712e0c3cbe1d40541 100644 (file)
@@ -67,7 +67,7 @@
 use syntax::ast::{Onceness, Purity};
 use syntax::ast;
 use syntax::owned_slice::OwnedSlice;
-use syntax::abi::AbiSet;
+use syntax::abi;
 
 pub trait Combine {
     fn infcx<'a>(&'a self) -> &'a InferCtxt<'a>;
@@ -195,10 +195,10 @@ fn relate_region_params<C:Combine>(this: &C,
     fn bare_fn_tys(&self, a: &ty::BareFnTy,
                    b: &ty::BareFnTy) -> cres<ty::BareFnTy> {
         let purity = if_ok!(self.purities(a.purity, b.purity));
-        let abi = if_ok!(self.abis(a.abis, b.abis));
+        let abi = if_ok!(self.abi(a.abi, b.abi));
         let sig = if_ok!(self.fn_sigs(&a.sig, &b.sig));
         Ok(ty::BareFnTy {purity: purity,
-                abis: abi,
+                abi: abi,
                 sig: sig})
     }
 
@@ -248,7 +248,7 @@ fn sigils(&self, p1: ast::Sigil, p2: ast::Sigil) -> cres<ast::Sigil> {
 
     fn purities(&self, a: Purity, b: Purity) -> cres<Purity>;
 
-    fn abis(&self, a: AbiSet, b: AbiSet) -> cres<AbiSet> {
+    fn abi(&self, a: abi::Abi, b: abi::Abi) -> cres<abi::Abi> {
         if a == b {
             Ok(a)
         } else {
@@ -373,28 +373,6 @@ pub fn eq_regions<C:Combine>(this: &C, a: ty::Region, b: ty::Region)
     })
 }
 
-pub fn eq_opt_regions<C:Combine>(
-    this: &C,
-    a: Option<ty::Region>,
-    b: Option<ty::Region>) -> cres<Option<ty::Region>> {
-
-    match (a, b) {
-        (None, None) => Ok(None),
-        (Some(a), Some(b)) => eq_regions(this, a, b).then(|| Ok(Some(a))),
-        (_, _) => {
-            // If these two substitutions are for the same type (and
-            // they should be), then the type should either
-            // consistently have a region parameter or not have a
-            // region parameter.
-            this.infcx().tcx.sess.bug(
-                format!("substitution a had opt_region {} and \
-                      b had opt_region {}",
-                     a.inf_str(this.infcx()),
-                     b.inf_str(this.infcx())));
-        }
-    }
-}
-
 pub fn super_fn_sigs<C:Combine>(this: &C, a: &ty::FnSig, b: &ty::FnSig) -> cres<ty::FnSig> {
 
     fn argvecs<C:Combine>(this: &C, a_args: &[ty::t], b_args: &[ty::t]) -> cres<Vec<ty::t> > {
index e846e3621bd46137fee75ea740fcd9aceb0f7f75..83fc315bcebc82f1465638f86828c275505eb6d9 100644 (file)
@@ -28,7 +28,7 @@
 use util::common::{indenter};
 use util::ppaux::mt_to_str;
 
-pub struct Glb<'f>(CombineFields<'f>);  // "greatest lower bound" (common subtype)
+pub struct Glb<'f>(pub CombineFields<'f>);  // "greatest lower bound" (common subtype)
 
 impl<'f> Glb<'f> {
     pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Glb(ref v) = *self; v }
index e63ad7322b9aebfb2dd5b533fdcb47985a305602..7f48e2333676aadb7d9a772c2e528ecd4f556f62 100644 (file)
 use syntax::ast::{Onceness, Purity};
 use util::ppaux::mt_to_str;
 
-pub struct Lub<'f>(CombineFields<'f>);  // least-upper-bound: common supertype
+pub struct Lub<'f>(pub CombineFields<'f>);  // least-upper-bound: common supertype
 
 impl<'f> Lub<'f> {
     pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Lub(ref v) = *self; v }
-    pub fn bot_ty(&self, b: ty::t) -> cres<ty::t> { Ok(b) }
-    pub fn ty_bot(&self, b: ty::t) -> cres<ty::t> {
-        self.bot_ty(b) // commutative
-    }
 }
 
 impl<'f> Combine for Lub<'f> {
index 41edc26e803d3118dc1b0d005cf2dc08e691f641..e01e34a0e5afd2802603e4d1d42f46ed8bc1322f 100644 (file)
@@ -421,19 +421,6 @@ pub fn mk_coercety(cx: &InferCtxt,
     })
 }
 
-pub fn can_mk_coercety(cx: &InferCtxt, a: ty::t, b: ty::t) -> ures {
-    debug!("can_mk_coercety({} -> {})", a.inf_str(cx), b.inf_str(cx));
-    indent(|| {
-        cx.probe(|| {
-            let trace = TypeTrace {
-                origin: Misc(codemap::DUMMY_SP),
-                values: Types(expected_found(true, a, b))
-            };
-            Coerce(cx.combine_fields(true, trace)).tys(a, b)
-        })
-    }).to_ures()
-}
-
 // See comment on the type `resolve_state` below
 pub fn resolve_type(cx: &InferCtxt,
                     a: ty::t,
@@ -631,10 +618,6 @@ pub fn next_int_var_id(&self) -> IntVid {
         result
     }
 
-    pub fn next_int_var(&self) -> ty::t {
-        ty::mk_int_var(self.tcx, self.next_int_var_id())
-    }
-
     pub fn next_float_var_id(&self) -> FloatVid {
         let mut float_var_counter = self.float_var_counter.get();
         let mut float_var_bindings = self.float_var_bindings.borrow_mut();
@@ -644,21 +627,10 @@ pub fn next_float_var_id(&self) -> FloatVid {
         result
     }
 
-    pub fn next_float_var(&self) -> ty::t {
-        ty::mk_float_var(self.tcx, self.next_float_var_id())
-    }
-
     pub fn next_region_var(&self, origin: RegionVariableOrigin) -> ty::Region {
         ty::ReInfer(ty::ReVar(self.region_vars.new_region_var(origin)))
     }
 
-    pub fn next_region_vars(&self,
-                            origin: RegionVariableOrigin,
-                            count: uint)
-                            -> Vec<ty::Region> {
-        Vec::from_fn(count, |_| self.next_region_var(origin))
-    }
-
     pub fn region_vars_for_defs(&self,
                                 span: Span,
                                 defs: &[ty::RegionParameterDef])
index 4bc0e765af50120012be35850368e3d8c1619613..5348a623d86cc3d82f8d154eba4a19a670b69c6e 100644 (file)
@@ -52,7 +52,7 @@
 use middle::ty;
 use middle::ty_fold;
 use middle::typeck::infer::{Bounds, cyclic_ty, fixup_err, fres, InferCtxt};
-use middle::typeck::infer::{region_var_bound_by_region_var, unresolved_ty};
+use middle::typeck::infer::unresolved_ty;
 use middle::typeck::infer::to_str::InferStr;
 use middle::typeck::infer::unify::{Root, UnifyInferCtxtMethods};
 use util::common::{indent, indenter};
 pub static resolve_rvar: uint        = 0b0000000010;
 pub static resolve_ivar: uint        = 0b0000000100;
 pub static resolve_fvar: uint        = 0b0000001000;
-pub static resolve_fnvar: uint       = 0b0000010000;
-pub static resolve_all: uint         = 0b0000011111;
+pub static resolve_all: uint         = 0b0000001111;
 pub static force_tvar: uint          = 0b0000100000;
 pub static force_rvar: uint          = 0b0001000000;
 pub static force_ivar: uint          = 0b0010000000;
 pub static force_fvar: uint          = 0b0100000000;
-pub static force_fnvar: uint         = 0b1000000000;
-pub static force_all: uint           = 0b1111100000;
+pub static force_all: uint           = 0b0111100000;
 
 pub static not_regions: uint         = !(force_rvar | resolve_rvar);
 
@@ -204,15 +202,6 @@ pub fn resolve_region_var(&mut self, rid: RegionVid) -> ty::Region {
         self.infcx.region_vars.resolve_var(rid)
     }
 
-    pub fn assert_not_rvar(&mut self, rid: RegionVid, r: ty::Region) {
-        match r {
-          ty::ReInfer(ty::ReVar(rid2)) => {
-            self.err = Some(region_var_bound_by_region_var(rid, rid2));
-          }
-          _ => { }
-        }
-    }
-
     pub fn resolve_ty_var(&mut self, vid: TyVid) -> ty::t {
         if self.v_seen.contains(&vid) {
             self.err = Some(cyclic_ty(vid));
index ef17a593654842dbc0666162bd45ba52f6685d90..b22e6f4677bd72d820234035fac339341ae4b43d 100644 (file)
@@ -27,7 +27,7 @@
 
 use syntax::ast::{Onceness, Purity};
 
-pub struct Sub<'f>(CombineFields<'f>);  // "subtype", "subregion" etc
+pub struct Sub<'f>(pub CombineFields<'f>);  // "subtype", "subregion" etc
 
 impl<'f> Sub<'f> {
     pub fn get_ref<'a>(&'a self) -> &'a CombineFields<'f> { let Sub(ref v) = *self; v }
index efb556ecea6984e59eb2753c6247c2a53ea6f64b..d635a9bdec41e03ae058fa06efb55ceb074c691e 100644 (file)
@@ -264,15 +264,6 @@ pub fn write_substs_to_tcx(tcx: &ty::ctxt,
         tcx.node_type_substs.borrow_mut().insert(node_id, substs);
     }
 }
-pub fn write_tpt_to_tcx(tcx: &ty::ctxt,
-                        node_id: ast::NodeId,
-                        tpt: &ty::ty_param_substs_and_ty) {
-    write_ty_to_tcx(tcx, node_id, tpt.ty);
-    if !tpt.substs.tps.is_empty() {
-        write_substs_to_tcx(tcx, node_id, tpt.substs.tps.clone());
-    }
-}
-
 pub fn lookup_def_tcx(tcx:&ty::ctxt, sp: Span, id: ast::NodeId) -> ast::Def {
     match tcx.def_map.borrow().find(&id) {
         Some(&x) => x,
@@ -367,7 +358,7 @@ fn check_main_fn_ty(ccx: &CrateCtxt,
             }
             let se_ty = ty::mk_bare_fn(tcx, ty::BareFnTy {
                 purity: ast::ImpureFn,
-                abis: abi::AbiSet::Rust(),
+                abi: abi::Rust,
                 sig: ty::FnSig {
                     binder_id: main_id,
                     inputs: Vec::new(),
@@ -413,7 +404,7 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
 
             let se_ty = ty::mk_bare_fn(tcx, ty::BareFnTy {
                 purity: ast::ImpureFn,
-                abis: abi::AbiSet::Rust(),
+                abi: abi::Rust,
                 sig: ty::FnSig {
                     binder_id: start_id,
                     inputs: vec!(
index cef047fae5df5e258eac95c49f7670485fe9f9dc..2abbd916d76276bee065f027c581ba9c8d4f88df 100644 (file)
@@ -14,7 +14,6 @@
 use std::cell::Cell;
 use syntax::ast;
 use syntax::codemap::Span;
-use syntax::owned_slice::OwnedSlice;
 
 /// Defines strategies for handling regions that are omitted.  For
 /// example, if one writes the type `&Foo`, then the lifetime of
@@ -72,10 +71,3 @@ fn anon_regions(&self,
                                                    ty::BrAnon(idx + i))))
     }
 }
-
-pub fn bound_type_regions(defs: &[ty::RegionParameterDef])
-                          -> OwnedSlice<ty::Region> {
-    assert!(defs.iter().all(|def| def.def_id.krate == ast::LOCAL_CRATE));
-    defs.iter().enumerate().map(
-        |(i, def)| ty::ReEarlyBound(def.def_id.node, i, def.name)).collect()
-}
index bdc27ceab2b2bd9543cda9c5425bdde24a8cd97e..ce8a34c4c23f5f5314c3fcb9da9314722eaadabd 100644 (file)
@@ -11,7 +11,6 @@
 #![allow(non_camel_case_types)]
 
 use syntax::ast;
-use syntax::codemap::{Span};
 use syntax::visit;
 use syntax::visit::Visitor;
 
@@ -64,12 +63,6 @@ pub fn indenter() -> _indenter {
     _indenter(())
 }
 
-pub fn field_expr(f: ast::Field) -> @ast::Expr { return f.expr; }
-
-pub fn field_exprs(fields: Vec<ast::Field> ) -> Vec<@ast::Expr> {
-    fields.move_iter().map(|f| f.expr).collect()
-}
-
 struct LoopQueryVisitor<'a> {
     p: 'a |&ast::Expr_| -> bool,
     flag: bool,
@@ -120,16 +113,3 @@ pub fn block_query(b: ast::P<ast::Block>, p: |&ast::Expr| -> bool) -> bool {
     visit::walk_block(&mut v, b, ());
     return v.flag;
 }
-
-pub fn local_rhs_span(l: &ast::Local, def: Span) -> Span {
-    match l.init {
-      Some(i) => return i.span,
-      _ => return def
-    }
-}
-
-pub fn pluralize(n: uint, s: ~str) -> ~str {
-    if n == 1 { s }
-    else { format!("{}s", s) }
-}
-
index 9b76d50a66479f9b2f628588f5b4ff7d710c4ed1..4a1be783d9d1d3563dec2a76d259a2c9dc0a41de 100644 (file)
@@ -23,7 +23,7 @@
 use middle::ty;
 use middle::typeck;
 
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::ast_map;
 use syntax::codemap::{Span, Pos};
 use syntax::parse::token;
@@ -58,14 +58,6 @@ pub fn note_and_explain_region(cx: &ctxt,
     }
 }
 
-/// Returns a string like "the block at 27:31" that attempts to explain a
-/// lifetime in a way it might plausibly be understood.
-pub fn explain_region(cx: &ctxt, region: ty::Region) -> ~str {
-  let (res, _) = explain_region_and_span(cx, region);
-  return res;
-}
-
-
 pub fn explain_region_and_span(cx: &ctxt, region: ty::Region)
                             -> (~str, Option<Span>) {
     return match region {
@@ -165,42 +157,6 @@ pub fn bound_region_to_str(cx: &ctxt,
     }
 }
 
-pub fn ReScope_id_to_str(cx: &ctxt, node_id: ast::NodeId) -> ~str {
-    match cx.map.find(node_id) {
-      Some(ast_map::NodeBlock(ref blk)) => {
-        format!("<block at {}>",
-             cx.sess.codemap().span_to_str(blk.span))
-      }
-      Some(ast_map::NodeExpr(expr)) => {
-        match expr.node {
-          ast::ExprCall(..) => {
-            format!("<call at {}>",
-                 cx.sess.codemap().span_to_str(expr.span))
-          }
-          ast::ExprMatch(..) => {
-            format!("<match at {}>",
-                 cx.sess.codemap().span_to_str(expr.span))
-          }
-          ast::ExprAssignOp(..) |
-          ast::ExprUnary(..) |
-          ast::ExprBinary(..) |
-          ast::ExprIndex(..) => {
-            format!("<method at {}>",
-                 cx.sess.codemap().span_to_str(expr.span))
-          }
-          _ => {
-            format!("<expression at {}>",
-                 cx.sess.codemap().span_to_str(expr.span))
-          }
-        }
-      }
-      None => {
-        format!("<unknown-{}>", node_id)
-      }
-      _ => cx.sess.bug(format!("ReScope refers to {}", cx.map.node_to_str(node_id)))
-    }
-}
-
 // In general, if you are giving a region error message,
 // you should use `explain_region()` or, better yet,
 // `note_and_explain_region()`
@@ -280,10 +236,6 @@ pub fn vec_map_to_str<T>(ts: &[T], f: |t: &T| -> ~str) -> ~str {
     format!("[{}]", tstrs.connect(", "))
 }
 
-pub fn tys_to_str(cx: &ctxt, ts: &[t]) -> ~str {
-    vec_map_to_str(ts, |t| ty_to_str(cx, *t))
-}
-
 pub fn fn_sig_to_str(cx: &ctxt, typ: &ty::FnSig) -> ~str {
     format!("fn{}{} -> {}",
             typ.binder_id,
@@ -301,14 +253,14 @@ fn fn_input_to_str(cx: &ctxt, input: ty::t) -> ~str {
     }
     fn bare_fn_to_str(cx: &ctxt,
                       purity: ast::Purity,
-                      abis: AbiSet,
+                      abi: abi::Abi,
                       ident: Option<ast::Ident>,
                       sig: &ty::FnSig)
                       -> ~str {
-        let mut s = if abis.is_rust() {
+        let mut s = if abi == abi::Rust {
             ~""
         } else {
-            format!("extern {} ", abis.to_str())
+            format!("extern {} ", abi.to_str())
         };
 
         match purity {
@@ -454,7 +406,7 @@ fn push_sig_to_str(cx: &ctxt,
           closure_to_str(cx, *f)
       }
       ty_bare_fn(ref f) => {
-          bare_fn_to_str(cx, f.purity, f.abis, None, &f.sig)
+          bare_fn_to_str(cx, f.purity, f.abi, None, &f.sig)
       }
       ty_infer(infer_ty) => infer_ty.to_str(),
       ty_err => ~"[type error]",
@@ -861,9 +813,9 @@ fn repr(&self, _tcx: &ctxt) -> ~str {
 
 impl Repr for ty::BareFnTy {
     fn repr(&self, tcx: &ctxt) -> ~str {
-        format!("BareFnTy \\{purity: {:?}, abis: {}, sig: {}\\}",
+        format!("BareFnTy \\{purity: {:?}, abi: {}, sig: {}\\}",
              self.purity,
-             self.abis.to_str(),
+             self.abi.to_str(),
              self.sig.repr(tcx))
     }
 }
@@ -1016,13 +968,13 @@ fn user_string(&self, _tcx: &ctxt) -> ~str {
     }
 }
 
-impl Repr for AbiSet {
+impl Repr for abi::Abi {
     fn repr(&self, _tcx: &ctxt) -> ~str {
         self.to_str()
     }
 }
 
-impl UserString for AbiSet {
+impl UserString for abi::Abi {
     fn user_string(&self, _tcx: &ctxt) -> ~str {
         self.to_str()
     }
index ff7f7c6e6f4bda76e7275c2c12b38d5cf5861db8..e92aec8e25c7c438d86f981bae30221836d22bb0 100644 (file)
@@ -975,7 +975,7 @@ fn clean(&self) -> BareFunctionDecl {
                 type_params: Vec::new(),
             },
             decl: self.decl.clean(),
-            abi: self.abis.to_str(),
+            abi: self.abi.to_str(),
         }
     }
 }
index bb6b1eeaedd5ee3995f00afddce270cfac94a7f0..60fcbe33a1be956e8e6671530e7d1aea5517ec76 100644 (file)
@@ -17,7 +17,7 @@
 
 /// Wrapper struct which will emit the HTML-escaped version of the contained
 /// string when passed to a format string.
-pub struct Escape<'a>(&'a str);
+pub struct Escape<'a>(pub &'a str);
 
 impl<'a> fmt::Show for Escape<'a> {
     fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
index acf6446a191f1ad7dc2166c9420d8c8c990d7e79..10c155262c31e504c2fbddb35fb81c192a070f04 100644 (file)
 
 /// Helper to render an optional visibility with a space after it (if the
 /// visibility is preset)
-pub struct VisSpace(Option<ast::Visibility>);
+pub struct VisSpace(pub Option<ast::Visibility>);
 /// Similarly to VisSpace, this structure is used to render a purity with a
 /// space after it.
-pub struct PuritySpace(ast::Purity);
+pub struct PuritySpace(pub ast::Purity);
 /// Wrapper struct for properly emitting a method declaration.
-pub struct Method<'a>(&'a clean::SelfTy, &'a clean::FnDecl);
+pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl);
 
 impl VisSpace {
     pub fn get(&self) -> Option<ast::Visibility> {
index c52a6267657b377919b43bb9f4aba7dd0be8395f..ff2462cfb22ba28f526dc2f3182fc398cebd350a 100644 (file)
 /// A unit struct which has the `fmt::Show` trait implemented. When
 /// formatted, this struct will emit the HTML corresponding to the rendered
 /// version of the contained markdown string.
-pub struct Markdown<'a>(&'a str);
+pub struct Markdown<'a>(pub &'a str);
 /// A unit struct like `Markdown`, that renders the markdown with a
 /// table of contents.
-pub struct MarkdownWithToc<'a>(&'a str);
+pub struct MarkdownWithToc<'a>(pub &'a str);
 
 static OUTPUT_UNIT: libc::size_t = 64;
 static MKDEXT_NO_INTRA_EMPHASIS: libc::c_uint = 1 << 0;
index d16802a23145f0acb1442d093d7ede05013c7d6b..5e53632dbba55b75ca0ad31b998c24d4801eeea1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "rustdoc#0.10-pre"]
+#![crate_id = "rustdoc#0.11-pre"]
 #![desc = "rustdoc, the Rust documentation extractor"]
 #![license = "MIT/ASL2"]
 #![crate_type = "dylib"]
@@ -168,6 +168,7 @@ pub fn main_args(args: &[~str]) -> int {
     let markdown_input = input.ends_with(".md") || input.ends_with(".markdown");
 
     let output = matches.opt_str("o").map(|s| Path::new(s));
+    let cfgs = matches.opt_strs("cfg");
 
     match (should_test, markdown_input) {
         (true, true) => {
@@ -175,7 +176,8 @@ pub fn main_args(args: &[~str]) -> int {
                                   libs,
                                   test_args.move_iter().collect())
         }
-        (true, false) => return test::run(input, libs, test_args),
+        (true, false) => return test::run(input, cfgs.move_iter().collect(),
+                                          libs, test_args),
 
         (false, true) => return markdown::render(input, output.unwrap_or(Path::new("doc")),
                                                  &matches),
index afc01d0eb62acd0b8e71a0c7a818d7e493e5133d..2138d210443f5f07d27a1964c951910b286644cb 100644 (file)
 use rustc::driver::driver;
 use rustc::driver::session;
 use rustc::metadata::creader::Loader;
+use syntax::ast;
+use syntax::codemap::{CodeMap, dummy_spanned};
 use syntax::diagnostic;
-use syntax::codemap::CodeMap;
+use syntax::parse::token;
 
 use core;
 use clean;
@@ -33,7 +35,8 @@
 use passes;
 use visit_ast::RustdocVisitor;
 
-pub fn run(input: &str, libs: HashSet<Path>, mut test_args: Vec<~str>) -> int {
+pub fn run(input: &str, cfgs: Vec<~str>,
+           libs: HashSet<Path>, mut test_args: Vec<~str>) -> int {
     let input_path = Path::new(input);
     let input = driver::FileInput(input_path.clone());
 
@@ -54,7 +57,11 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: Vec<~str>) -> int {
                                       Some(input_path),
                                       span_diagnostic_handler);
 
-    let cfg = driver::build_configuration(&sess);
+    let mut cfg = driver::build_configuration(&sess);
+    cfg.extend(cfgs.move_iter().map(|cfg_| {
+        let cfg_ = token::intern_and_get_ident(cfg_);
+        @dummy_spanned(ast::MetaWord(cfg_))
+    }));
     let krate = driver::phase_1_parse_input(&sess, cfg, &input);
     let (krate, _) = driver::phase_2_configure_and_expand(&sess, &mut Loader::new(&sess), krate,
                                                           &from_str("rustdoc-test").unwrap());
@@ -160,17 +167,14 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
 
 fn maketest(s: &str, cratename: &str, loose_feature_gating: bool) -> ~str {
     let mut prog = ~r"
-#[deny(warnings)];
-#[allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)];
-
-// FIXME: remove when ~[] disappears from tests.
-#[allow(deprecated_owned_vector)];
+#![deny(warnings)]
+#![allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)]
 ";
 
     if loose_feature_gating {
         // FIXME #12773: avoid inserting these when the tutorial & manual
         // etc. have been updated to not use them so prolifically.
-        prog.push_str("#[ feature(macro_rules, globs, struct_variant, managed_boxes) ];\n");
+        prog.push_str("#![feature(macro_rules, globs, struct_variant, managed_boxes) ]\n");
     }
 
     if !s.contains("extern crate") {
index 78c6940244c392474c39bba70616ac019da9f7eb..a6c1ece6400edee9e7a323f3e1670e1640ec2f9d 100644 (file)
@@ -11,7 +11,7 @@
 //! Rust AST Visitor. Extracts useful information and massages it into a form
 //! usable for clean
 
-use syntax::abi::AbiSet;
+use syntax::abi;
 use syntax::ast;
 use syntax::ast_util;
 use syntax::ast_map;
@@ -95,7 +95,7 @@ pub fn visit_enum_def(&mut self, it: &ast::Item, def: &ast::EnumDef,
     }
 
     pub fn visit_fn(&mut self, item: &ast::Item, fd: &ast::FnDecl,
-                    purity: &ast::Purity, _abi: &AbiSet,
+                    purity: &ast::Purity, _abi: &abi::Abi,
                     gen: &ast::Generics) -> Function {
         debug!("Visiting fn");
         Function {
index 01067cb699b82b1811d7cdabe86d88a9bc058c7a..22cb82926375013e4d31555508be4b89e0e55774 100644 (file)
@@ -34,7 +34,7 @@
 
 */
 
-#![crate_id = "rustuv#0.10-pre"]
+#![crate_id = "rustuv#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
index c30c0075e355b760bff19fddf16fb9b0330db5c5..60a72dabb572908f6acb5ad28bcc3fded3b75a1a 100644 (file)
@@ -28,7 +28,7 @@
 //! An example version number with all five components is
 //! `0.8.1-rc.3.0+20130922.linux`.
 
-#![crate_id = "semver#0.10-pre"]
+#![crate_id = "semver#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 6aad2f5abbf58da0ecfd47263cd2db4ee774565a..13e4a010a5e189e74b276cf71214e50e6fe97658 100644 (file)
@@ -23,11 +23,11 @@ pub enum CharacterSet {
 /// Contains configuration parameters for `to_base64`.
 pub struct Config {
     /// Character set to use
-    char_set: CharacterSet,
+    pub char_set: CharacterSet,
     /// True to pad output with `=` characters
-    pad: bool,
+    pub pad: bool,
     /// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
-    line_length: Option<uint>
+    pub line_length: Option<uint>
 }
 
 /// Configuration for RFC 4648 standard base64 encoding
index b3a529601a4edbd15d4bef90f672399534f74743..7d50ad86aeb009429b7cce9bccd3ee4eff700e26 100644 (file)
@@ -14,7 +14,7 @@
 Core encoding and decoding interfaces.
 */
 
-#![crate_id = "serialize#0.10-pre"]
+#![crate_id = "serialize#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index fb6c1b4c8a3a8776f990d93e21e8b8cc4157b5e2..5177bc08890b6f01f941cc886d0f085ef2d621ee 100644 (file)
@@ -43,7 +43,7 @@
 //!
 //!     use std::prelude::*;
 
-#![crate_id = "std#0.10-pre"]
+#![crate_id = "std#0.11-pre"]
 #![comment = "The Rust standard library"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
@@ -232,4 +232,5 @@ mod std {
     pub use to_str;
     pub use ty;
     pub use unstable;
+    pub use vec;
 }
index 9b1c5a406cf69a7ad94ac39244ffab61688c3268..1a35252f8cadda48a178b24db40b27dcc8734b24 100644 (file)
@@ -332,3 +332,262 @@ macro_rules! log (
         if log_enabled!($lvl) { println!($($args)*) }
     )
 )
+
+/// Built-in macros to the compiler itself.
+///
+/// These macros do not have any corresponding definition with a `macro_rules!`
+/// macro, but are documented here. Their implementations can be found hardcoded
+/// into libsyntax itself.
+#[cfg(dox)]
+pub mod builtin {
+    /// The core macro for formatted string creation & output.
+    ///
+    /// This macro takes as its first argument a callable expression which will
+    /// receive as its first argument a value of type `&fmt::Arguments`. This
+    /// value can be passed to the functions in `std::fmt` for performing useful
+    /// functions. All other formatting macros (`format!`, `write!`,
+    /// `println!`, etc) are proxied through this one.
+    ///
+    /// For more information, see the documentation in `std::fmt`.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// use std::fmt;
+    ///
+    /// let s = format_args!(fmt::format, "hello {}", "world");
+    /// assert_eq!(s, format!("hello {}", "world"));
+    ///
+    /// format_args!(|args| {
+    ///     // pass `args` to another function, etc.
+    /// }, "hello {}", "world");
+    /// ```
+    #[macro_export]
+    macro_rules! format_args( ($closure:expr, $fmt:expr $($args:tt)*) => ({
+        /* compiler built-in */
+    }) )
+
+    /// Inspect an environment variable at compile time.
+    ///
+    /// This macro will expand to the value of the named environment variable at
+    /// compile time, yielding an expression of type `&'static str`.
+    ///
+    /// If the environment variable is not defined, then a compilation error
+    /// will be emitted.  To not emit a compile error, use the `option_env!`
+    /// macro instead.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// let user: &'static str = env!("USER");
+    /// println!("the user who compiled this code is: {}", user);
+    /// ```
+    #[macro_export]
+    macro_rules! env( ($name:expr) => ({ /* compiler built-in */ }) )
+
+    /// Optionally inspect an environment variable at compile time.
+    ///
+    /// If the named environment variable is present at compile time, this will
+    /// expand into an expression of type `Option<&'static str>` whose value is
+    /// `Some` of the value of the environment variable. If the environment
+    /// variable is not present, then this will expand to `None`.
+    ///
+    /// A compile time error is never emitted when using this macro regardless
+    /// of whether the environment variable is present or not.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// let key: Option<&'static str> = option_env!("SECRET_KEY");
+    /// println!("the secret key might be: {}", key);
+    /// ```
+    #[macro_export]
+    macro_rules! option_env( ($name:expr) => ({ /* compiler built-in */ }) )
+
+    /// Concatenate literals into a static byte slice.
+    ///
+    /// This macro takes any number of comma-separated literal expressions,
+    /// yielding an expression of type `&'static [u8]` which is the
+    /// concatenation (left to right) of all the literals in their byte format.
+    ///
+    /// This extension currently only supports string literals, character
+    /// literals, and integers less than 256. The byte slice returned is the
+    /// utf8-encoding of strings and characters.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let rust = bytes!("r", 'u', "st");
+    /// assert_eq!(rust[1], 'u' as u8);
+    /// ```
+    #[macro_export]
+    macro_rules! bytes( ($($e:expr),*) => ({ /* compiler built-in */ }) )
+
+    /// Concatenate identifiers into one identifier.
+    ///
+    /// This macro takes any number of comma-separated identifiers, and
+    /// concatenates them all into one, yielding an expression which is a new
+    /// identifier. Note that hygiene makes it such that this macro cannot
+    /// capture local variables, and macros are only allowed in item,
+    /// statement or expression position, meaning this macro may be difficult to
+    /// use in some situations.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// fn foobar() -> int { 23 }
+    ///
+    /// let f = concat_idents!(foo, bar);
+    /// println!("{}", f());
+    /// ```
+    #[macro_export]
+    macro_rules! concat_idents( ($($e:ident),*) => ({ /* compiler built-in */ }) )
+
+    /// Concatenates literals into a static string slice.
+    ///
+    /// This macro takes any number of comma-separated literals, yielding an
+    /// expression of type `&'static str` which represents all of the literals
+    /// concatenated left-to-right.
+    ///
+    /// Integer and floating point literals are stringified in order to be
+    /// concatenated.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let s = concat!("test", 10, 'b', true);
+    /// assert_eq!(s, "test10btrue");
+    /// ```
+    #[macro_export]
+    macro_rules! concat( ($($e:expr),*) => ({ /* compiler built-in */ }) )
+
+    /// A macro which expands to the line number on which it was invoked.
+    ///
+    /// The expanded expression has type `uint`, and the returned line is not
+    /// the invocation of the `line!()` macro itself, but rather the first macro
+    /// invocation leading up to the invocation of the `line!()` macro.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let current_line = line!();
+    /// println!("defined on line: {}", current_line);
+    /// ```
+    #[macro_export]
+    macro_rules! line( () => ({ /* compiler built-in */ }) )
+
+    /// A macro which expands to the column number on which it was invoked.
+    ///
+    /// The expanded expression has type `uint`, and the returned column is not
+    /// the invocation of the `col!()` macro itself, but rather the first macro
+    /// invocation leading up to the invocation of the `col!()` macro.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let current_col = col!();
+    /// println!("defined on column: {}", current_col);
+    /// ```
+    #[macro_export]
+    macro_rules! col( () => ({ /* compiler built-in */ }) )
+
+    /// A macro which expands to the file name from which it was invoked.
+    ///
+    /// The expanded expression has type `&'static str`, and the returned file
+    /// is not the invocation of the `file!()` macro itself, but rather the
+    /// first macro invocation leading up to the invocation of the `file!()`
+    /// macro.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let this_file = file!();
+    /// println!("defined in file: {}", this_file);
+    /// ```
+    #[macro_export]
+    macro_rules! file( () => ({ /* compiler built-in */ }) )
+
+    /// A macro which stringifies its argument.
+    ///
+    /// This macro will yield an expression of type `&'static str` which is the
+    /// stringification of all the tokens passed to the macro. No restrictions
+    /// are placed on the syntax of the macro invocation itself.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// let one_plus_one = stringify!(1 + 1);
+    /// assert_eq!(one_plus_one, "1 + 1");
+    /// ```
+    #[macro_export]
+    macro_rules! stringify( ($t:tt) => ({ /* compiler built-in */ }) )
+
+    /// Includes a utf8-encoded file as a string.
+    ///
+    /// This macro will yield an expression of type `&'static str` which is the
+    /// contents of the filename specified. The file is located relative to the
+    /// current file (similarly to how modules are found),
+    ///
+    /// # Example
+    ///
+    /// ```rust,ignore
+    /// let secret_key = include_str!("secret-key.ascii");
+    /// ```
+    #[macro_export]
+    macro_rules! include_str( ($file:expr) => ({ /* compiler built-in */ }) )
+
+    /// Includes a file as a byte slice.
+    ///
+    /// This macro will yield an expression of type `&'static [u8]` which is
+    /// the contents of the filename specified. The file is located relative to
+    /// the current file (similarly to how modules are found),
+    ///
+    /// # Example
+    ///
+    /// ```rust,ignore
+    /// let secret_key = include_bin!("secret-key.bin");
+    /// ```
+    #[macro_export]
+    macro_rules! include_bin( ($file:expr) => ({ /* compiler built-in */ }) )
+
+    /// Expands to a string that represents the current module path.
+    ///
+    /// The current module path can be thought of as the hierarchy of modules
+    /// leading back up to the crate root. The first component of the path
+    /// returned is the name of the crate currently being compiled.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// mod test {
+    ///     pub fn foo() {
+    ///         assert!(module_path!().ends_with("test"));
+    ///     }
+    /// }
+    ///
+    /// test::foo();
+    /// ```
+    #[macro_export]
+    macro_rules! module_path( () => ({ /* compiler built-in */ }) )
+
+    /// Boolean evaluation of configuration flags.
+    ///
+    /// In addition to the `#[cfg]` attribute, this macro is provided to allow
+    /// boolean expression evaluation of configuration flags. This frequently
+    /// leads to less duplicated code.
+    ///
+    /// The syntax given to this macro is the same syntax as the `cfg`
+    /// attribute.
+    ///
+    /// # Example
+    ///
+    /// ```rust
+    /// let my_directory = if cfg!(windows) {
+    ///     "windows-specific-directory"
+    /// } else {
+    ///     "unix-directory"
+    /// };
+    /// ```
+    #[macro_export]
+    macro_rules! cfg( ($cfg:tt) => ({ /* compiler built-in */ }) )
+}
index 23b23cf8af024ec85fc4f04de38534a65a451806..5c1b6cd47910addec9809d2f69af499161be96f7 100644 (file)
@@ -68,8 +68,17 @@ pub unsafe fn realloc_raw(ptr: *mut u8, size: uint) -> *mut u8 {
 #[cfg(not(test))]
 #[lang="exchange_malloc"]
 #[inline]
-pub unsafe fn exchange_malloc(size: uint) -> *u8 {
-    malloc_raw(size) as *u8
+pub unsafe fn exchange_malloc(size: uint) -> *mut u8 {
+    // The compiler never calls `exchange_free` on ~ZeroSizeType, so zero-size
+    // allocations can point to this `static`. It would be incorrect to use a null
+    // pointer, due to enums assuming types like unique pointers are never null.
+    static EMPTY: () = ();
+
+    if size == 0 {
+        &EMPTY as *() as *mut u8
+    } else {
+        malloc_raw(size)
+    }
 }
 
 // FIXME: #7496
index 0f90135512c3c667d21d9080882ef569945af0c5..fc266df11e4be4a1f36b69678e19739044cf84d7 100644 (file)
@@ -58,7 +58,7 @@ pub struct Task {
 }
 
 pub struct GarbageCollector;
-pub struct LocalStorage(Option<local_data::Map>);
+pub struct LocalStorage(pub Option<local_data::Map>);
 
 /// A handle to a blocked task. Usually this means having the ~Task pointer by
 /// ownership, but if the task is killable, a killer can steal it at any time.
index 234eae1f97b7f8ef5e0ac69220b85fcba7adb190..71e67971b458df5ccce9642b0a3a240e18d5b515 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
+// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
 //
@@ -462,6 +462,51 @@ pub fn fetch_add(&self, val: int, order: Ordering) -> int {
     pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_sub(self.v.get(), val, order) }
     }
+
+    /// Bitwise and with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_and(0b110011, SeqCst));
+    /// assert_eq!(0b100001, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_and(&self, val: int, order: Ordering) -> int {
+        unsafe { atomic_and(self.v.get(), val, order) }
+    }
+
+    /// Bitwise or with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_or(0b110011, SeqCst));
+    /// assert_eq!(0b111111, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_or(&self, val: int, order: Ordering) -> int {
+        unsafe { atomic_or(self.v.get(), val, order) }
+    }
+
+    /// Bitwise xor with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_xor(0b110011, SeqCst));
+    /// assert_eq!(0b011110, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
+        unsafe { atomic_xor(self.v.get(), val, order) }
+    }
 }
 
 impl AtomicUint {
@@ -529,6 +574,51 @@ pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
     pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_sub(self.v.get(), val, order) }
     }
+
+    /// Bitwise and with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_and(0b110011, SeqCst));
+    /// assert_eq!(0b100001, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
+        unsafe { atomic_and(self.v.get(), val, order) }
+    }
+
+    /// Bitwise or with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_or(0b110011, SeqCst));
+    /// assert_eq!(0b111111, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
+        unsafe { atomic_or(self.v.get(), val, order) }
+    }
+
+    /// Bitwise xor with the current value, returning the previous
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::sync::atomics::{AtomicUint, SeqCst};
+    ///
+    /// let foo = AtomicUint::new(0b101101);
+    /// assert_eq!(0b101101, foo.fetch_xor(0b110011, SeqCst));
+    /// assert_eq!(0b011110, foo.load(SeqCst));
+    #[inline]
+    pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
+        unsafe { atomic_xor(self.v.get(), val, order) }
+    }
 }
 
 impl<T> AtomicPtr<T> {
@@ -843,6 +933,48 @@ fn bool_and() {
         assert_eq!(a.load(SeqCst),false);
     }
 
+    #[test]
+    fn uint_and() {
+        let x = AtomicUint::new(0xf731);
+        assert_eq!(x.fetch_and(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 & 0x137f);
+    }
+
+    #[test]
+    fn uint_or() {
+        let x = AtomicUint::new(0xf731);
+        assert_eq!(x.fetch_or(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 | 0x137f);
+    }
+
+    #[test]
+    fn uint_xor() {
+        let x = AtomicUint::new(0xf731);
+        assert_eq!(x.fetch_xor(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 ^ 0x137f);
+    }
+
+    #[test]
+    fn int_and() {
+        let x = AtomicInt::new(0xf731);
+        assert_eq!(x.fetch_and(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 & 0x137f);
+    }
+
+    #[test]
+    fn int_or() {
+        let x = AtomicInt::new(0xf731);
+        assert_eq!(x.fetch_or(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 | 0x137f);
+    }
+
+    #[test]
+    fn int_xor() {
+        let x = AtomicInt::new(0xf731);
+        assert_eq!(x.fetch_xor(0x137f, SeqCst), 0xf731);
+        assert_eq!(x.load(SeqCst), 0xf731 ^ 0x137f);
+    }
+
     static mut S_BOOL : AtomicBool = INIT_ATOMIC_BOOL;
     static mut S_INT  : AtomicInt  = INIT_ATOMIC_INT;
     static mut S_UINT : AtomicUint = INIT_ATOMIC_UINT;
index 01200833b195d699d7f0738ed25d136499d683e7..a7a314d35e7368bdf62d270b66d38ac72055fcc4 100644 (file)
 
 #[experimental]
 #[simd]
-pub struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8);
+pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8,
+                 pub i8, pub i8, pub i8, pub i8);
 
 #[experimental]
 #[simd]
-pub struct i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
+pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
+                 pub i16, pub i16, pub i16, pub i16);
 
 #[experimental]
 #[simd]
-pub struct i32x4(i32, i32, i32, i32);
+pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
 
 #[experimental]
 #[simd]
-pub struct i64x2(i64, i64);
+pub struct i64x2(pub i64, pub i64);
 
 #[experimental]
 #[simd]
-pub struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8);
+pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8,
+                 pub u8, pub u8, pub u8, pub u8);
 
 #[experimental]
 #[simd]
-pub struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16);
+pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
+                 pub u16, pub u16, pub u16, pub u16);
 
 #[experimental]
 #[simd]
-pub struct u32x4(u32, u32, u32, u32);
+pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
 
 #[experimental]
 #[simd]
-pub struct u64x2(u64, u64);
+pub struct u64x2(pub u64, pub u64);
 
 #[experimental]
 #[simd]
-pub struct f32x4(f32, f32, f32, f32);
+pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
 
 #[experimental]
 #[simd]
-pub struct f64x2(f64, f64);
+pub struct f64x2(pub f64, pub f64);
index 69c3a85b2f16057b3f03746ad7cf735b6a9433c3..e414ff25d433539eb419d3e556883f17d3e3c71e 100644 (file)
@@ -310,11 +310,24 @@ pub fn partitioned(&self, f: |&T| -> bool) -> (Vec<T>, Vec<T>) {
 
 impl<T:Clone> Clone for Vec<T> {
     fn clone(&self) -> Vec<T> {
-        let mut vector = Vec::with_capacity(self.len());
-        for element in self.iter() {
-            vector.push((*element).clone())
+        self.iter().map(|x| x.clone()).collect()
+    }
+
+    fn clone_from(&mut self, other: &Vec<T>) {
+        // drop anything in self that will not be overwritten
+        if self.len() > other.len() {
+            self.truncate(other.len())
         }
-        vector
+
+        // reuse the contained values' allocations/resources.
+        for (place, thing) in self.mut_iter().zip(other.iter()) {
+            place.clone_from(thing)
+        }
+
+        // self.len <= other.len due to the truncate above, so the
+        // slice here is always in-bounds.
+        let len = self.len();
+        self.extend(other.slice_from(len).iter().map(|x| x.clone()));
     }
 }
 
@@ -1475,4 +1488,39 @@ fn test_mut_split_at() {
 
         assert!(values == Vec::from_slice([2u8, 3, 5, 6, 7]));
     }
+
+    #[test]
+    fn test_clone() {
+        let v: Vec<int> = vec!();
+        let w = vec!(1, 2, 3);
+
+        assert_eq!(v, v.clone());
+
+        let z = w.clone();
+        assert_eq!(w, z);
+        // they should be disjoint in memory.
+        assert!(w.as_ptr() != z.as_ptr())
+    }
+
+    #[test]
+    fn test_clone_from() {
+        let mut v = vec!();
+        let three = vec!(~1, ~2, ~3);
+        let two = vec!(~4, ~5);
+        // zero, long
+        v.clone_from(&three);
+        assert_eq!(v, three);
+
+        // equal
+        v.clone_from(&three);
+        assert_eq!(v, three);
+
+        // long, short
+        v.clone_from(&two);
+        assert_eq!(v, two);
+
+        // short, long
+        v.clone_from(&three);
+        assert_eq!(v, three)
+    }
 }
index 4ecf8d32470a7597d703def58f8f2438158bf44b..7e7a6afc8ee71908c8d3353c7f6e7903c839e506 100644 (file)
@@ -12,7 +12,7 @@
  * Concurrency-enabled mechanisms and primitives.
  */
 
-#![crate_id = "sync#0.10-pre"]
+#![crate_id = "sync#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index caded1dc0b84532998336af1f13b41876d156500..17251d31351ab303b72be6c41091c02391280fba 100644 (file)
@@ -9,12 +9,11 @@
 // except according to those terms.
 
 use std::fmt;
-use std::fmt::Show;
 
 #[deriving(Eq)]
 pub enum Os { OsWin32, OsMacos, OsLinux, OsAndroid, OsFreebsd, }
 
-#[deriving(Eq, TotalEq, Hash)]
+#[deriving(Eq, TotalEq, Hash, Encodable, Decodable, Clone)]
 pub enum Abi {
     // NB: This ordering MUST match the AbiDatas array below.
     // (This is ensured by the test indices_are_correct().)
@@ -65,11 +64,6 @@ pub enum AbiArchitecture {
     Archs(u32)  // Multiple architectures (bitset)
 }
 
-#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
-pub struct AbiSet {
-    bits: u32   // each bit represents one of the abis below
-}
-
 static AbiDatas: &'static [AbiData] = &[
     // Platform-specific ABIs
     AbiData {abi: Cdecl, name: "cdecl", abi_arch: Archs(IntelBits)},
@@ -136,12 +130,20 @@ pub fn name(&self) -> &'static str {
         self.data().name
     }
 
-    pub fn for_target(&self, os: Os, arch: Architecture) -> Abi {
-        match (*self, os, arch) {
+    pub fn for_target(&self, os: Os, arch: Architecture) -> Option<Abi> {
+        // If this ABI isn't actually for the specified architecture, then we
+        // short circuit early
+        match self.data().abi_arch {
+            Archs(a) if a & arch.bit() == 0 => return None,
+            Archs(_) | RustArch | AllArch => {}
+        }
+        // Transform this ABI as appropriate for the requested os/arch
+        // combination.
+        Some(match (*self, os, arch) {
             (System, OsWin32, X86) => Stdcall,
             (System, _, _) => C,
             (me, _, _) => me,
-        }
+        })
     }
 }
 
@@ -151,138 +153,9 @@ fn bit(&self) -> u32 {
     }
 }
 
-impl AbiSet {
-    pub fn from(abi: Abi) -> AbiSet {
-        AbiSet { bits: (1 << abi.index()) }
-    }
-
-    #[inline]
-    pub fn Rust() -> AbiSet {
-        AbiSet::from(Rust)
-    }
-
-    #[inline]
-    pub fn C() -> AbiSet {
-        AbiSet::from(C)
-    }
-
-    #[inline]
-    pub fn Intrinsic() -> AbiSet {
-        AbiSet::from(RustIntrinsic)
-    }
-
-    pub fn default() -> AbiSet {
-        AbiSet::C()
-    }
-
-    pub fn empty() -> AbiSet {
-        AbiSet { bits: 0 }
-    }
-
-    #[inline]
-    pub fn is_rust(&self) -> bool {
-        self.bits == 1 << Rust.index()
-    }
-
-    #[inline]
-    pub fn is_c(&self) -> bool {
-        self.bits == 1 << C.index()
-    }
-
-    #[inline]
-    pub fn is_intrinsic(&self) -> bool {
-        self.bits == 1 << RustIntrinsic.index()
-    }
-
-    pub fn contains(&self, abi: Abi) -> bool {
-        (self.bits & (1 << abi.index())) != 0
-    }
-
-    pub fn subset_of(&self, other_abi_set: AbiSet) -> bool {
-        (self.bits & other_abi_set.bits) == self.bits
-    }
-
-    pub fn add(&mut self, abi: Abi) {
-        self.bits |= 1 << abi.index();
-    }
-
-    pub fn each(&self, op: |abi: Abi| -> bool) -> bool {
-        each_abi(|abi| !self.contains(abi) || op(abi))
-    }
-
-    pub fn is_empty(&self) -> bool {
-        self.bits == 0
-    }
-
-    pub fn for_target(&self, os: Os, arch: Architecture) -> Option<Abi> {
-        // NB---Single platform ABIs come first
-
-        let mut res = None;
-
-        self.each(|abi| {
-            let data = abi.data();
-            match data.abi_arch {
-                Archs(a) if (a & arch.bit()) != 0 => { res = Some(abi); false }
-                Archs(_) => { true }
-                RustArch | AllArch => { res = Some(abi); false }
-            }
-        });
-
-        res.map(|r| r.for_target(os, arch))
-    }
-
-    pub fn check_valid(&self) -> Option<(Abi, Abi)> {
-        let mut abis = Vec::new();
-        self.each(|abi| { abis.push(abi); true });
-
-        for (i, abi) in abis.iter().enumerate() {
-            let data = abi.data();
-            for other_abi in abis.slice(0, i).iter() {
-                let other_data = other_abi.data();
-                debug!("abis=({:?},{:?}) datas=({:?},{:?})",
-                       abi, data.abi_arch,
-                       other_abi, other_data.abi_arch);
-                match (&data.abi_arch, &other_data.abi_arch) {
-                    (&AllArch, &AllArch) => {
-                        // Two cross-architecture ABIs
-                        return Some((*abi, *other_abi));
-                    }
-                    (_, &RustArch) |
-                    (&RustArch, _) => {
-                        // Cannot combine Rust or Rust-Intrinsic with
-                        // anything else.
-                        return Some((*abi, *other_abi));
-                    }
-                    (&Archs(is), &Archs(js)) if (is & js) != 0 => {
-                        // Two ABIs for same architecture
-                        return Some((*abi, *other_abi));
-                    }
-                    _ => {}
-                }
-            }
-        }
-
-        return None;
-    }
-}
-
 impl fmt::Show for Abi {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.data().name.fmt(f)
-    }
-}
-
-impl fmt::Show for AbiSet {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        try!(write!(f.buf, "\""));
-        let mut first = true;
-        self.each(|abi| {
-            if first { first = false; }
-            else { let _ = write!(f.buf, " "); }
-            let _ = write!(f.buf, "{}", abi.data().name);
-            true
-        });
-        write!(f.buf, "\"")
+        write!(f.buf, "\"{}\"", self.name())
     }
 }
 
@@ -304,95 +177,6 @@ fn lookup_baz() {
     assert!(abi.is_none());
 }
 
-#[cfg(test)]
-fn cannot_combine(n: Abi, m: Abi) {
-    let mut set = AbiSet::empty();
-    set.add(n);
-    set.add(m);
-    match set.check_valid() {
-        Some((a, b)) => {
-            assert!((n == a && m == b) ||
-                         (m == a && n == b));
-        }
-        None => {
-            fail!("invalid match not detected");
-        }
-    }
-}
-
-#[cfg(test)]
-fn can_combine(n: Abi, m: Abi) {
-    let mut set = AbiSet::empty();
-    set.add(n);
-    set.add(m);
-    match set.check_valid() {
-        Some((_, _)) => {
-            fail!("valid match declared invalid");
-        }
-        None => {}
-    }
-}
-
-#[test]
-fn cannot_combine_cdecl_and_stdcall() {
-    cannot_combine(Cdecl, Stdcall);
-}
-
-#[test]
-fn cannot_combine_c_and_rust() {
-    cannot_combine(C, Rust);
-}
-
-#[test]
-fn cannot_combine_rust_and_cdecl() {
-    cannot_combine(Rust, Cdecl);
-}
-
-#[test]
-fn cannot_combine_rust_intrinsic_and_cdecl() {
-    cannot_combine(RustIntrinsic, Cdecl);
-}
-
-#[test]
-fn can_combine_system_and_cdecl() {
-    can_combine(System, Cdecl);
-}
-
-#[test]
-fn can_combine_c_and_stdcall() {
-    can_combine(C, Stdcall);
-}
-
-#[test]
-fn can_combine_aapcs_and_stdcall() {
-    can_combine(Aapcs, Stdcall);
-}
-
-#[test]
-fn abi_to_str_stdcall_aaps() {
-    let mut set = AbiSet::empty();
-    set.add(Aapcs);
-    set.add(Stdcall);
-    assert!(set.to_str() == ~"\"stdcall aapcs\"");
-}
-
-#[test]
-fn abi_to_str_c_aaps() {
-    let mut set = AbiSet::empty();
-    set.add(Aapcs);
-    set.add(C);
-    debug!("set = {}", set.to_str());
-    assert!(set.to_str() == ~"\"aapcs C\"");
-}
-
-#[test]
-fn abi_to_str_rust() {
-    let mut set = AbiSet::empty();
-    set.add(Rust);
-    debug!("set = {}", set.to_str());
-    assert!(set.to_str() == ~"\"Rust\"");
-}
-
 #[test]
 fn indices_are_correct() {
     for (i, abi_data) in AbiDatas.iter().enumerate() {
@@ -407,30 +191,14 @@ fn indices_are_correct() {
     assert_eq!(ArmBits, bits);
 }
 
-#[cfg(test)]
-fn get_arch(abis: &[Abi], os: Os, arch: Architecture) -> Option<Abi> {
-    let mut set = AbiSet::empty();
-    for &abi in abis.iter() {
-        set.add(abi);
-    }
-    set.for_target(os, arch)
-}
-
-#[test]
-fn pick_multiplatform() {
-    assert_eq!(get_arch([C, Cdecl], OsLinux, X86), Some(Cdecl));
-    assert_eq!(get_arch([C, Cdecl], OsLinux, X86_64), Some(Cdecl));
-    assert_eq!(get_arch([C, Cdecl], OsLinux, Arm), Some(C));
-}
-
 #[test]
 fn pick_uniplatform() {
-    assert_eq!(get_arch([Stdcall], OsLinux, X86), Some(Stdcall));
-    assert_eq!(get_arch([Stdcall], OsLinux, Arm), None);
-    assert_eq!(get_arch([System], OsLinux, X86), Some(C));
-    assert_eq!(get_arch([System], OsWin32, X86), Some(Stdcall));
-    assert_eq!(get_arch([System], OsWin32, X86_64), Some(C));
-    assert_eq!(get_arch([System], OsWin32, Arm), Some(C));
-    assert_eq!(get_arch([Stdcall], OsWin32, X86), Some(Stdcall));
-    assert_eq!(get_arch([Stdcall], OsWin32, X86_64), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsLinux, X86), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsLinux, Arm), None);
+    assert_eq!(System.for_target(OsLinux, X86), Some(C));
+    assert_eq!(System.for_target(OsWin32, X86), Some(Stdcall));
+    assert_eq!(System.for_target(OsWin32, X86_64), Some(C));
+    assert_eq!(System.for_target(OsWin32, Arm), Some(C));
+    assert_eq!(Stdcall.for_target(OsWin32, X86), Some(Stdcall));
+    assert_eq!(Stdcall.for_target(OsWin32, X86_64), Some(Stdcall));
 }
index 3a9cdfb56e32a36424bd91bb47c2124670cafd80..53d2ac97b49fb746363e54cd1b523c8eb05b9c08 100644 (file)
@@ -11,7 +11,7 @@
 // The Rust abstract syntax tree.
 
 use codemap::{Span, Spanned, DUMMY_SP};
-use abi::AbiSet;
+use abi::Abi;
 use ast_util;
 use owned_slice::OwnedSlice;
 use parse::token::{InternedString, special_idents, str_to_ident};
@@ -493,10 +493,10 @@ pub enum Expr_ {
     ExprVstore(@Expr, ExprVstore),
     // First expr is the place; second expr is the value.
     ExprBox(@Expr, @Expr),
-    ExprVec(Vec<@Expr> , Mutability),
-    ExprCall(@Expr, Vec<@Expr> ),
-    ExprMethodCall(Ident, Vec<P<Ty>> , Vec<@Expr> ),
-    ExprTup(Vec<@Expr> ),
+    ExprVec(Vec<@Expr>, Mutability),
+    ExprCall(@Expr, Vec<@Expr>),
+    ExprMethodCall(Ident, Vec<P<Ty>>, Vec<@Expr>),
+    ExprTup(Vec<@Expr>),
     ExprBinary(BinOp, @Expr, @Expr),
     ExprUnary(UnOp, @Expr),
     ExprLit(@Lit),
@@ -508,14 +508,14 @@ pub enum Expr_ {
     // Conditionless loop (can be exited with break, cont, or ret)
     // FIXME #6993: change to Option<Name>
     ExprLoop(P<Block>, Option<Ident>),
-    ExprMatch(@Expr, Vec<Arm> ),
+    ExprMatch(@Expr, Vec<Arm>),
     ExprFnBlock(P<FnDecl>, P<Block>),
     ExprProc(P<FnDecl>, P<Block>),
     ExprBlock(P<Block>),
 
     ExprAssign(@Expr, @Expr),
     ExprAssignOp(BinOp, @Expr, @Expr),
-    ExprField(@Expr, Ident, Vec<P<Ty>> ),
+    ExprField(@Expr, Ident, Vec<P<Ty>>),
     ExprIndex(@Expr, @Expr),
 
     /// Expression that looks like a "name". For example,
@@ -807,7 +807,7 @@ pub struct ClosureTy {
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct BareFnTy {
     pub purity: Purity,
-    pub abis: AbiSet,
+    pub abi: Abi,
     pub lifetimes: Vec<Lifetime>,
     pub decl: P<FnDecl>
 }
@@ -941,7 +941,7 @@ pub struct Mod {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct ForeignMod {
-    pub abis: AbiSet,
+    pub abi: Abi,
     pub view_items: Vec<ViewItem>,
     pub items: Vec<@ForeignItem>,
 }
@@ -1119,7 +1119,7 @@ pub struct Item {
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub enum Item_ {
     ItemStatic(P<Ty>, Mutability, @Expr),
-    ItemFn(P<FnDecl>, Purity, AbiSet, Generics, P<Block>),
+    ItemFn(P<FnDecl>, Purity, Abi, Generics, P<Block>),
     ItemMod(Mod),
     ItemForeignMod(ForeignMod),
     ItemTy(P<Ty>, Generics),
index f07b0e71c1ce1245f9a9c30482851da13ac2ef73..cf584ff62ac02670536b8bf793a18f88055b8a99 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use abi::AbiSet;
+use abi;
 use ast::*;
 use ast_util;
 use codemap::Span;
@@ -66,7 +66,7 @@ fn next(&mut self) -> Option<PathElem> {
 
 // HACK(eddyb) move this into libstd (value wrapper for slice::Items).
 #[deriving(Clone)]
-pub struct Values<'a, T>(slice::Items<'a, T>);
+pub struct Values<'a, T>(pub slice::Items<'a, T>);
 
 impl<'a, T: Copy> Iterator<T> for Values<'a, T> {
     fn next(&mut self) -> Option<T> {
@@ -224,19 +224,19 @@ pub fn get_parent_did(&self, id: NodeId) -> DefId {
         }
     }
 
-    pub fn get_foreign_abis(&self, id: NodeId) -> AbiSet {
+    pub fn get_foreign_abi(&self, id: NodeId) -> abi::Abi {
         let parent = self.get_parent(id);
-        let abis = match self.find_entry(parent) {
+        let abi = match self.find_entry(parent) {
             Some(EntryItem(_, i)) => match i.node {
-                ItemForeignMod(ref nm) => Some(nm.abis),
+                ItemForeignMod(ref nm) => Some(nm.abi),
                 _ => None
             },
             // Wrong but OK, because the only inlined foreign items are intrinsics.
-            Some(RootInlinedParent(_)) => Some(AbiSet::Intrinsic()),
+            Some(RootInlinedParent(_)) => Some(abi::RustIntrinsic),
             _ => None
         };
-        match abis {
-            Some(abis) => abis,
+        match abi {
+            Some(abi) => abi,
             None => fail!("expected foreign mod or inlined parent, found {}",
                           self.node_to_str(parent))
         }
index 0d2492d7fad0f0de698ab6591c14fa8a39c076ba..7cadce547659446734e0078bba547f8a4e4ce135 100644 (file)
@@ -33,13 +33,13 @@ pub trait Pos {
 /// A byte offset. Keep this small (currently 32-bits), as AST contains
 /// a lot of them.
 #[deriving(Clone, Eq, TotalEq, Hash, Ord, Show)]
-pub struct BytePos(u32);
+pub struct BytePos(pub u32);
 
 /// A character offset. Because of multibyte utf8 characters, a byte offset
 /// is not equivalent to a character offset. The CodeMap will convert BytePos
 /// values to CharPos values as necessary.
 #[deriving(Eq, Hash, Ord, Show)]
-pub struct CharPos(uint);
+pub struct CharPos(pub uint);
 
 // FIXME: Lots of boilerplate in these impls, but so far my attempts to fix
 // have been unsuccessful
index 489af0fc2d477096ffb4bdc66f005f12ebc73b43..ef62f0a01f6c1fdb12a8bcdfdf553cd7c34157d1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use abi::AbiSet;
+use abi;
 use ast::{P, Ident};
 use ast;
 use ast_util;
@@ -826,7 +826,7 @@ fn item_fn_poly(&self,
                   Vec::new(),
                   ast::ItemFn(self.fn_decl(inputs, output),
                               ast::ImpureFn,
-                              AbiSet::Rust(),
+                              abi::Rust,
                               generics,
                               body))
     }
index 03963219d52c403dc7149d142b1060c065942187..06bf892771dc6b6e6971c367e3d2cf9b5075f4d8 100644 (file)
@@ -170,7 +170,7 @@ fn fold_ty(&mut self, t: P<Ty>) -> P<Ty> {
                 TyBareFn(@BareFnTy {
                     lifetimes: f.lifetimes.iter().map(|l| fold_lifetime(l, self)).collect(),
                     purity: f.purity,
-                    abis: f.abis,
+                    abi: f.abi,
                     decl: self.fold_fn_decl(f.decl)
                 })
             }
@@ -198,7 +198,7 @@ fn fold_mod(&mut self, m: &Mod) -> Mod {
 
     fn fold_foreign_mod(&mut self, nm: &ForeignMod) -> ForeignMod {
         ast::ForeignMod {
-            abis: nm.abis,
+            abi: nm.abi,
             view_items: nm.view_items
                           .iter()
                           .map(|x| self.fold_view_item(x))
index e25a84d6cd45d939094645a3b0f18667eccb3ce8..5570219bd8e4f41ba022ca778c9eedeace7469b8 100644 (file)
@@ -18,7 +18,7 @@
 
 */
 
-#![crate_id = "syntax#0.10-pre"]
+#![crate_id = "syntax#0.11-pre"]
 #![license = "MIT/ASL2"]
 #![crate_type = "dylib"]
 #![crate_type = "rlib"]
index 76126e6780a2b7f7ed3dd24f0ea9d81bedb4e790..dbb85972774e71b9e3dfcda0f394c28f94bf6bd6 100644 (file)
@@ -657,7 +657,7 @@ fn parser_done(p: Parser){
                                 variadic: false
                             }),
                                     ast::ImpureFn,
-                                    abi::AbiSet::Rust(),
+                                    abi::Rust,
                                     ast::Generics{ // no idea on either of these:
                                         lifetimes: Vec::new(),
                                         ty_params: OwnedSlice::empty(),
index b3e488a464d9c3058c325d1e5d494aff7975675e..2d78bfe5694c1130233afad698feef2c68d7f937 100644 (file)
@@ -11,7 +11,6 @@
 #![macro_escape]
 
 use abi;
-use abi::AbiSet;
 use ast::{Sigil, BorrowedSigil, ManagedSigil, OwnedSigil};
 use ast::{BareFnTy, ClosureTy};
 use ast::{RegionTyParamBound, TraitTyParamBound};
@@ -873,17 +872,17 @@ pub fn parse_ty_bare_fn(&mut self) -> Ty_ {
 
         */
 
-        let abis = if self.eat_keyword(keywords::Extern) {
-            self.parse_opt_abis().unwrap_or(AbiSet::C())
+        let abi = if self.eat_keyword(keywords::Extern) {
+            self.parse_opt_abi().unwrap_or(abi::C)
         } else {
-            AbiSet::Rust()
+            abi::Rust
         };
 
         let purity = self.parse_unsafety();
         self.expect_keyword(keywords::Fn);
         let (decl, lifetimes) = self.parse_ty_fn_decl(true);
         return TyBareFn(@BareFnTy {
-            abis: abis,
+            abi: abi,
             purity: purity,
             lifetimes: lifetimes,
             decl: decl
@@ -3770,11 +3769,11 @@ fn mk_item(&mut self, lo: BytePos, hi: BytePos, ident: Ident,
     }
 
     // parse an item-position function declaration.
-    fn parse_item_fn(&mut self, purity: Purity, abis: AbiSet) -> ItemInfo {
+    fn parse_item_fn(&mut self, purity: Purity, abi: abi::Abi) -> ItemInfo {
         let (ident, generics) = self.parse_fn_header();
         let decl = self.parse_fn_decl(false);
         let (inner_attrs, body) = self.parse_inner_attrs_and_block();
-        (ident, ItemFn(decl, purity, abis, generics, body), Some(inner_attrs))
+        (ident, ItemFn(decl, purity, abi, generics, body), Some(inner_attrs))
     }
 
     // parse a method in a trait impl, starting with `attrs` attributes.
@@ -4237,7 +4236,7 @@ fn parse_fn_purity(&mut self) -> Purity {
     // at this point, this is essentially a wrapper for
     // parse_foreign_items.
     fn parse_foreign_mod_items(&mut self,
-                               abis: AbiSet,
+                               abi: abi::Abi,
                                first_item_attrs: Vec<Attribute> )
                                -> ForeignMod {
         let ParsedItemsAndViewItems {
@@ -4252,7 +4251,7 @@ fn parse_foreign_mod_items(&mut self,
         }
         assert!(self.token == token::RBRACE);
         ast::ForeignMod {
-            abis: abis,
+            abi: abi,
             view_items: view_items,
             items: foreign_items
         }
@@ -4310,17 +4309,17 @@ fn parse_item_extern_crate(&mut self,
     /// extern {}
     fn parse_item_foreign_mod(&mut self,
                               lo: BytePos,
-                              opt_abis: Option<AbiSet>,
+                              opt_abi: Option<abi::Abi>,
                               visibility: Visibility,
                               attrs: Vec<Attribute> )
                               -> ItemOrViewItem {
 
         self.expect(&token::LBRACE);
 
-        let abis = opt_abis.unwrap_or(AbiSet::C());
+        let abi = opt_abi.unwrap_or(abi::C);
 
         let (inner, next) = self.parse_inner_attrs_and_next();
-        let m = self.parse_foreign_mod_items(abis, next);
+        let m = self.parse_foreign_mod_items(abi, next);
         self.expect(&token::RBRACE);
 
         let item = self.mk_item(lo,
@@ -4440,45 +4439,29 @@ fn fn_expr_lookahead(tok: &token::Token) -> bool {
 
     // Parses a string as an ABI spec on an extern type or module. Consumes
     // the `extern` keyword, if one is found.
-    fn parse_opt_abis(&mut self) -> Option<AbiSet> {
+    fn parse_opt_abi(&mut self) -> Option<abi::Abi> {
         match self.token {
-            token::LIT_STR(s)
-            | token::LIT_STR_RAW(s, _) => {
+            token::LIT_STR(s) | token::LIT_STR_RAW(s, _) => {
                 self.bump();
                 let identifier_string = token::get_ident(s);
                 let the_string = identifier_string.get();
-                let mut abis = AbiSet::empty();
-                for word in the_string.words() {
-                    match abi::lookup(word) {
-                        Some(abi) => {
-                            if abis.contains(abi) {
-                                self.span_err(
-                                    self.span,
-                                    format!("ABI `{}` appears twice",
-                                         word));
-                            } else {
-                                abis.add(abi);
-                            }
-                        }
-
-                        None => {
-                            self.span_err(
-                                self.span,
-                                format!("illegal ABI: \
-                                      expected one of [{}], \
-                                      found `{}`",
-                                     abi::all_names().connect(", "),
-                                     word));
-                        }
-                     }
-                 }
-                Some(abis)
+                match abi::lookup(the_string) {
+                    Some(abi) => Some(abi),
+                    None => {
+                        self.span_err(
+                            self.span,
+                            format!("illegal ABI: \
+                                  expected one of [{}], \
+                                  found `{}`",
+                                 abi::all_names().connect(", "),
+                                 the_string));
+                        None
+                    }
+                }
             }
 
-            _ => {
-                None
-             }
-         }
+            _ => None,
+        }
     }
 
     // parse one of the items or view items allowed by the
@@ -4531,13 +4514,13 @@ fn parse_item_or_view_item(&mut self,
                 return self.parse_item_extern_crate(lo, visibility, attrs);
             }
 
-            let opt_abis = self.parse_opt_abis();
+            let opt_abi = self.parse_opt_abi();
 
             if self.eat_keyword(keywords::Fn) {
                 // EXTERN FUNCTION ITEM
-                let abis = opt_abis.unwrap_or(AbiSet::C());
+                let abi = opt_abi.unwrap_or(abi::C);
                 let (ident, item_, extra_attrs) =
-                    self.parse_item_fn(ExternFn, abis);
+                    self.parse_item_fn(ExternFn, abi);
                 let item = self.mk_item(lo,
                                         self.last_span.hi,
                                         ident,
@@ -4546,7 +4529,7 @@ fn parse_item_or_view_item(&mut self,
                                         maybe_append(attrs, extra_attrs));
                 return IoviItem(item);
             } else if self.token == token::LBRACE {
-                return self.parse_item_foreign_mod(lo, opt_abis, visibility, attrs);
+                return self.parse_item_foreign_mod(lo, opt_abi, visibility, attrs);
             }
 
             let token_str = self.this_token_to_str();
@@ -4572,7 +4555,7 @@ fn parse_item_or_view_item(&mut self,
             // FUNCTION ITEM
             self.bump();
             let (ident, item_, extra_attrs) =
-                self.parse_item_fn(ImpureFn, AbiSet::Rust());
+                self.parse_item_fn(ImpureFn, abi::Rust);
             let item = self.mk_item(lo,
                                     self.last_span.hi,
                                     ident,
@@ -4587,7 +4570,7 @@ fn parse_item_or_view_item(&mut self,
             self.bump();
             self.expect_keyword(keywords::Fn);
             let (ident, item_, extra_attrs) =
-                self.parse_item_fn(UnsafeFn, AbiSet::Rust());
+                self.parse_item_fn(UnsafeFn, abi::Rust);
             let item = self.mk_item(lo,
                                     self.last_span.hi,
                                     ident,
index 98a3ff309162390574efe160fd12bd47aeaefb1e..1eee0fb87d6bf15a7edab52d6369ee6edd35ee9d 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use abi::AbiSet;
+use abi;
 use ast::{P, RegionTyParamBound, TraitTyParamBound, Required, Provided};
 use ast;
 use ast_util;
@@ -190,7 +190,7 @@ pub fn fun_to_str(decl: &ast::FnDecl, purity: ast::Purity, name: ast::Ident,
                   opt_explicit_self: Option<ast::ExplicitSelf_>,
                   generics: &ast::Generics) -> ~str {
     to_str(|s| {
-        try!(s.print_fn(decl, Some(purity), AbiSet::Rust(),
+        try!(s.print_fn(decl, Some(purity), abi::Rust,
                         name, generics, opt_explicit_self, ast::Inherited));
         try!(s.end()); // Close the head box
         s.end() // Close the outer box
@@ -478,7 +478,7 @@ pub fn print_type(&mut self, ty: &ast::Ty) -> IoResult<()> {
                     lifetimes: f.lifetimes.clone(),
                     ty_params: OwnedSlice::empty()
                 };
-                try!(self.print_ty_fn(Some(f.abis), None, &None,
+                try!(self.print_ty_fn(Some(f.abi), None, &None,
                                    f.purity, ast::Many, f.decl, None, &None,
                                    Some(&generics), None));
             }
@@ -524,7 +524,7 @@ pub fn print_foreign_item(&mut self,
         try!(self.print_outer_attributes(item.attrs.as_slice()));
         match item.node {
             ast::ForeignItemFn(decl, ref generics) => {
-                try!(self.print_fn(decl, None, AbiSet::Rust(), item.ident, generics,
+                try!(self.print_fn(decl, None, abi::Rust, item.ident, generics,
                 None, item.vis));
                 try!(self.end()); // end head-ibox
                 try!(word(&mut self.s, ";"));
@@ -590,7 +590,7 @@ pub fn print_item(&mut self, item: &ast::Item) -> IoResult<()> {
             }
             ast::ItemForeignMod(ref nmod) => {
                 try!(self.head("extern"));
-                try!(self.word_nbsp(nmod.abis.to_str()));
+                try!(self.word_nbsp(nmod.abi.to_str()));
                 try!(self.bopen());
                 try!(self.print_foreign_mod(nmod, item.attrs.as_slice()));
                 try!(self.bclose(item.span));
@@ -883,7 +883,7 @@ pub fn print_method(&mut self, meth: &ast::Method) -> IoResult<()> {
         try!(self.hardbreak_if_not_bol());
         try!(self.maybe_print_comment(meth.span.lo));
         try!(self.print_outer_attributes(meth.attrs.as_slice()));
-        try!(self.print_fn(meth.decl, Some(meth.purity), AbiSet::Rust(),
+        try!(self.print_fn(meth.decl, Some(meth.purity), abi::Rust,
                         meth.ident, &meth.generics, Some(meth.explicit_self.node),
                         meth.vis));
         try!(word(&mut self.s, " "));
@@ -1717,14 +1717,14 @@ fn print_explicit_self(&mut self,
     pub fn print_fn(&mut self,
                     decl: &ast::FnDecl,
                     purity: Option<ast::Purity>,
-                    abis: AbiSet,
+                    abi: abi::Abi,
                     name: ast::Ident,
                     generics: &ast::Generics,
                     opt_explicit_self: Option<ast::ExplicitSelf_>,
                     vis: ast::Visibility) -> IoResult<()> {
         try!(self.head(""));
-        try!(self.print_fn_header_info(opt_explicit_self, purity, abis,
-                                    ast::Many, None, vis));
+        try!(self.print_fn_header_info(opt_explicit_self, purity, abi,
+                                       ast::Many, None, vis));
         try!(self.nbsp());
         try!(self.print_ident(name));
         try!(self.print_generics(generics));
@@ -2016,7 +2016,7 @@ pub fn print_arg(&mut self, input: &ast::Arg) -> IoResult<()> {
     }
 
     pub fn print_ty_fn(&mut self,
-                       opt_abis: Option<AbiSet>,
+                       opt_abi: Option<abi::Abi>,
                        opt_sigil: Option<ast::Sigil>,
                        opt_region: &Option<ast::Lifetime>,
                        purity: ast::Purity,
@@ -2034,14 +2034,14 @@ pub fn print_ty_fn(&mut self,
         if opt_sigil == Some(ast::OwnedSigil) && onceness == ast::Once {
             try!(word(&mut self.s, "proc"));
         } else if opt_sigil == Some(ast::BorrowedSigil) {
-            try!(self.print_extern_opt_abis(opt_abis));
+            try!(self.print_extern_opt_abi(opt_abi));
             for lifetime in opt_region.iter() {
                 try!(self.print_lifetime(lifetime));
             }
             try!(self.print_purity(purity));
             try!(self.print_onceness(onceness));
         } else {
-            try!(self.print_opt_abis_and_extern_if_nondefault(opt_abis));
+            try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
             try!(self.print_opt_sigil(opt_sigil));
             try!(self.print_opt_lifetime(opt_region));
             try!(self.print_purity(purity));
@@ -2303,24 +2303,25 @@ pub fn print_opt_purity(&mut self,
         }
     }
 
-    pub fn print_opt_abis_and_extern_if_nondefault(&mut self,
-                                                   opt_abis: Option<AbiSet>)
+    pub fn print_opt_abi_and_extern_if_nondefault(&mut self,
+                                                  opt_abi: Option<abi::Abi>)
         -> IoResult<()> {
-        match opt_abis {
-            Some(abis) if !abis.is_rust() => {
+        match opt_abi {
+            Some(abi::Rust) => Ok(()),
+            Some(abi) => {
                 try!(self.word_nbsp("extern"));
-                self.word_nbsp(abis.to_str())
+                self.word_nbsp(abi.to_str())
             }
-            Some(_) | None => Ok(())
+            None => Ok(())
         }
     }
 
-    pub fn print_extern_opt_abis(&mut self,
-                                 opt_abis: Option<AbiSet>) -> IoResult<()> {
-        match opt_abis {
-            Some(abis) => {
+    pub fn print_extern_opt_abi(&mut self,
+                                opt_abi: Option<abi::Abi>) -> IoResult<()> {
+        match opt_abi {
+            Some(abi) => {
                 try!(self.word_nbsp("extern"));
-                self.word_nbsp(abis.to_str())
+                self.word_nbsp(abi.to_str())
             }
             None => Ok(())
         }
@@ -2339,15 +2340,15 @@ pub fn print_opt_sigil(&mut self,
     pub fn print_fn_header_info(&mut self,
                                 _opt_explicit_self: Option<ast::ExplicitSelf_>,
                                 opt_purity: Option<ast::Purity>,
-                                abis: AbiSet,
+                                abi: abi::Abi,
                                 onceness: ast::Onceness,
                                 opt_sigil: Option<ast::Sigil>,
                                 vis: ast::Visibility) -> IoResult<()> {
         try!(word(&mut self.s, visibility_qualified(vis, "")));
 
-        if abis != AbiSet::Rust() {
+        if abi != abi::Rust {
             try!(self.word_nbsp("extern"));
-            try!(self.word_nbsp(abis.to_str()));
+            try!(self.word_nbsp(abi.to_str()));
 
             if opt_purity != Some(ast::ExternFn) {
                 try!(self.print_opt_purity(opt_purity));
index de3eb1b9b8d6d9ef6b28e742e1e65fe8936a02e3..eb03bb1f0bbe046db848bc624599fb47fbc98f23 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use abi::AbiSet;
+use abi::Abi;
 use ast::*;
 use ast;
 use codemap::Span;
@@ -29,7 +29,7 @@
 
 pub enum FnKind<'a> {
     // fn foo() or extern "Abi" fn foo()
-    FkItemFn(Ident, &'a Generics, Purity, AbiSet),
+    FkItemFn(Ident, &'a Generics, Purity, Abi),
 
     // fn foo(&self)
     FkMethod(Ident, &'a Generics, &'a Method),
index 15ba5266cb30f9e128177312eac2c0448343360c..05104d5729f9149f99ed03b336ea0fed9a0af12e 100644 (file)
@@ -10,7 +10,7 @@
 
 //! Simple ANSI color library
 
-#![crate_id = "term#0.10-pre"]
+#![crate_id = "term#0.11-pre"]
 #![comment = "Simple ANSI color library"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
index b1d4fead43bbcdddf2ada7ac872ba9a2c2dee862..622375d8a6c88957cdef8f5934f4b5b4cae14d72 100644 (file)
@@ -23,7 +23,7 @@
 // running tests while providing a base that other test frameworks may
 // build off of.
 
-#![crate_id = "test#0.10-pre"]
+#![crate_id = "test#0.11-pre"]
 #![comment = "Rust internal test library only used by rustc"]
 #![license = "MIT/ASL2"]
 #![crate_type = "rlib"]
index 0ed8a9c8d454ba8b6624ab483ab254e691a4cc60..f3398942575a78aadae6c7bf7a5f696623f5b2e8 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "time#0.10-pre"]
+#![crate_id = "time#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 41bfa7e3ef8dcbf478b70e5a66860508f69b69ef..1146e602ac5cf4382c1c941b3f37c6710656753b 100644 (file)
@@ -10,7 +10,7 @@
 
 //! Types/fns concerning URLs (see RFC 3986)
 
-#![crate_id = "url#0.10-pre"]
+#![crate_id = "url#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index f70cb908b52d0a5d62d2022fd929dcce9493da13..7daca07e261e84f06c741e38a77bfe2b7bdacef3 100644 (file)
@@ -54,7 +54,7 @@ fn main() {
 
 */
 
-#![crate_id = "uuid#0.10-pre"]
+#![crate_id = "uuid#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 571f43401205817c6ee13dba73e6f6b9a78200b5..6c1a52f4eee57140c6ba7d4f0879c3c84e54fc8f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_id = "workcache#0.10-pre"]
+#![crate_id = "workcache#0.11-pre"]
 #![crate_type = "rlib"]
 #![crate_type = "dylib"]
 #![license = "MIT/ASL2"]
index 4755c7873fcb2114f66d765cc0f584f6908a1297..5a00a8034e6bc6dda6eb4616c6a0c8082de70a96 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "rustllvm.h"
 #include "llvm/Object/Archive.h"
+#include "llvm/Object/ObjectFile.h"
 
 //===----------------------------------------------------------------------===
 //
@@ -679,3 +680,27 @@ extern "C" int
 LLVMVersionMinor() {
     return LLVM_VERSION_MINOR;
 }
+
+// Note that the two following functions look quite similar to the
+// LLVMGetSectionName function. Sadly, it appears that this function only
+// returns a char* pointer, which isn't guaranteed to be null-terminated. The
+// function provided by LLVM doesn't return the length, so we've created our own
+// function which returns the length as well as the data pointer.
+//
+// For an example of this not returning a null terminated string, see
+// lib/Object/COFFObjectFile.cpp in the getSectionName function. One of the
+// branches explicitly creates a StringRef without a null terminator, and then
+// that's returned.
+
+inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
+    return reinterpret_cast<section_iterator*>(SI);
+}
+
+extern "C" int
+LLVMRustGetSectionName(LLVMSectionIteratorRef SI, const char **ptr) {
+    StringRef ret;
+    if (error_code ec = (*unwrap(SI))->getName(ret))
+      report_fatal_error(ec.message());
+    *ptr = ret.data();
+    return ret.size();
+}
diff --git a/src/rustllvm/rustllvm.def.in b/src/rustllvm/rustllvm.def.in
deleted file mode 100644 (file)
index 0b4a619..0000000
+++ /dev/null
@@ -1,635 +0,0 @@
-LLVMRustCreateMemoryBufferWithContentsOfFile
-LLVMRustWriteOutputFile
-LLVMRustGetLastError
-LLVMRustConstSmallInt
-LLVMRustConstInt
-LLVMRustPrintPassTimings
-LLVMRustStartMultithreading
-LLVMCreateObjectFile
-LLVMDisposeObjectFile
-LLVMDisposeExecutionEngine
-LLVMGetSections
-LLVMDisposeSectionIterator
-LLVMIsSectionIteratorAtEnd
-LLVMMoveToNextSection
-LLVMGetSectionName
-LLVMGetSectionSize
-LLVMGetSectionContents
-LLVMABIAlignmentOfType
-LLVMABISizeOfType
-LLVMAddAggressiveDCEPass
-LLVMAddAlias
-LLVMAddArgumentPromotionPass
-LLVMAddAttribute
-LLVMAddBasicAliasAnalysisPass
-LLVMAddCFGSimplificationPass
-LLVMAddCase
-LLVMAddClause
-LLVMAddConstantMergePass
-LLVMAddConstantPropagationPass
-LLVMAddCorrelatedValuePropagationPass
-LLVMAddDeadArgEliminationPass
-LLVMAddDeadStoreEliminationPass
-LLVMAddDemoteMemoryToRegisterPass
-LLVMAddDestination
-LLVMAddEarlyCSEPass
-LLVMAddFunction
-LLVMAddFunctionAttr
-LLVMAddFunctionAttrString
-LLVMAddFunctionAttrsPass
-LLVMAddFunctionInliningPass
-LLVMAddGVNPass
-LLVMAddGlobal
-LLVMAddGlobalDCEPass
-LLVMAddGlobalInAddressSpace
-LLVMAddGlobalOptimizerPass
-LLVMAddIPConstantPropagationPass
-LLVMAddIPSCCPPass
-LLVMAddIncoming
-LLVMAddIndVarSimplifyPass
-LLVMAddInstrAttribute
-LLVMAddInstructionCombiningPass
-LLVMAddInternalizePass
-LLVMAddJumpThreadingPass
-LLVMAddLICMPass
-LLVMAddLoopDeletionPass
-LLVMAddLoopIdiomPass
-LLVMAddLoopRotatePass
-LLVMAddLoopUnrollPass
-LLVMAddLoopUnswitchPass
-LLVMAddMemCpyOptPass
-LLVMAddNamedMetadataOperand
-LLVMAddPromoteMemoryToRegisterPass
-LLVMAddPruneEHPass
-LLVMAddReassociatePass
-LLVMAddSCCPPass
-LLVMAddScalarReplAggregatesPass
-LLVMAddScalarReplAggregatesPassSSA
-LLVMAddScalarReplAggregatesPassWithThreshold
-LLVMAddSimplifyLibCallsPass
-LLVMAddStripDeadPrototypesPass
-LLVMAddStripSymbolsPass
-LLVMAddTailCallEliminationPass
-LLVMAddTargetData
-LLVMAddTypeBasedAliasAnalysisPass
-LLVMAddVerifierPass
-LLVMAlignOf
-LLVMAppendBasicBlock
-LLVMAppendBasicBlockInContext
-LLVMArrayType
-LLVMBasicBlockAsValue
-LLVMBlockAddress
-LLVMBuildAShr
-LLVMBuildAtomicLoad
-LLVMBuildAtomicStore
-LLVMBuildAtomicCmpXchg
-LLVMBuildAtomicRMW
-LLVMBuildAtomicFence
-LLVMBuildAdd
-LLVMBuildAggregateRet
-LLVMBuildAlloca
-LLVMBuildAnd
-LLVMBuildArrayAlloca
-LLVMBuildArrayMalloc
-LLVMBuildBinOp
-LLVMBuildBitCast
-LLVMBuildBr
-LLVMBuildCall
-LLVMBuildCast
-LLVMBuildCondBr
-LLVMBuildExactSDiv
-LLVMBuildExtractElement
-LLVMBuildExtractValue
-LLVMBuildFAdd
-LLVMBuildFCmp
-LLVMBuildFDiv
-LLVMBuildFMul
-LLVMBuildFNeg
-LLVMBuildFPCast
-LLVMBuildFPExt
-LLVMBuildFPToSI
-LLVMBuildFPToUI
-LLVMBuildFPTrunc
-LLVMBuildFRem
-LLVMBuildFSub
-LLVMBuildFree
-LLVMBuildGEP
-LLVMBuildGlobalString
-LLVMBuildGlobalStringPtr
-LLVMBuildICmp
-LLVMBuildInBoundsGEP
-LLVMBuildIndirectBr
-LLVMBuildInsertElement
-LLVMBuildInsertValue
-LLVMBuildIntCast
-LLVMBuildIntToPtr
-LLVMBuildInvoke
-LLVMBuildIsNotNull
-LLVMBuildIsNull
-LLVMBuildLandingPad
-LLVMBuildLShr
-LLVMBuildLoad
-LLVMBuildMalloc
-LLVMBuildMul
-LLVMBuildNSWAdd
-LLVMBuildNSWMul
-LLVMBuildNSWNeg
-LLVMBuildNSWSub
-LLVMBuildNUWAdd
-LLVMBuildNUWMul
-LLVMBuildNUWNeg
-LLVMBuildNUWSub
-LLVMBuildNeg
-LLVMBuildNot
-LLVMBuildOr
-LLVMBuildPhi
-LLVMBuildPointerCast
-LLVMBuildPtrDiff
-LLVMBuildPtrToInt
-LLVMBuildResume
-LLVMBuildRet
-LLVMBuildRetVoid
-LLVMBuildSDiv
-LLVMBuildSExt
-LLVMBuildSExtOrBitCast
-LLVMBuildSIToFP
-LLVMBuildSRem
-LLVMBuildSelect
-LLVMBuildShl
-LLVMBuildShuffleVector
-LLVMBuildStore
-LLVMBuildStructGEP
-LLVMBuildSub
-LLVMBuildSwitch
-LLVMBuildTrunc
-LLVMBuildTruncOrBitCast
-LLVMBuildUDiv
-LLVMBuildUIToFP
-LLVMBuildURem
-LLVMBuildUnreachable
-LLVMBuildVAArg
-LLVMBuildXor
-LLVMBuildZExt
-LLVMBuildZExtOrBitCast
-LLVMByteOrder
-LLVMCallFrameAlignmentOfType
-LLVMClearInsertionPosition
-LLVMConstAShr
-LLVMConstAdd
-LLVMConstAllOnes
-LLVMConstAnd
-LLVMConstArray
-LLVMConstBitCast
-LLVMConstExactSDiv
-LLVMConstExtractElement
-LLVMConstExtractValue
-LLVMConstFAdd
-LLVMConstFCmp
-LLVMConstFDiv
-LLVMConstFMul
-LLVMConstFNeg
-LLVMConstFPCast
-LLVMConstFPExt
-LLVMConstFPToSI
-LLVMConstFPToUI
-LLVMConstFPTrunc
-LLVMConstFRem
-LLVMConstFSub
-LLVMConstGEP
-LLVMConstICmp
-LLVMConstInBoundsGEP
-LLVMConstInlineAsm
-LLVMConstInsertElement
-LLVMConstInsertValue
-LLVMConstInt
-LLVMConstIntCast
-LLVMConstIntGetSExtValue
-LLVMConstIntGetZExtValue
-LLVMConstIntOfArbitraryPrecision
-LLVMConstIntOfString
-LLVMConstIntOfStringAndSize
-LLVMConstIntToPtr
-LLVMConstLShr
-LLVMConstMul
-LLVMConstNSWAdd
-LLVMConstNSWMul
-LLVMConstNSWNeg
-LLVMConstNSWSub
-LLVMConstNUWAdd
-LLVMConstNUWMul
-LLVMConstNUWNeg
-LLVMConstNUWSub
-LLVMConstNeg
-LLVMConstNot
-LLVMConstNull
-LLVMConstOr
-LLVMConstPointerCast
-LLVMConstPointerNull
-LLVMConstPtrToInt
-LLVMConstReal
-LLVMConstRealOfString
-LLVMConstRealOfStringAndSize
-LLVMConstSDiv
-LLVMConstSExt
-LLVMConstSExtOrBitCast
-LLVMConstSIToFP
-LLVMConstSRem
-LLVMConstSelect
-LLVMConstShl
-LLVMConstShuffleVector
-LLVMConstString
-LLVMConstStringInContext
-LLVMConstStruct
-LLVMConstStructInContext
-LLVMConstSub
-LLVMConstTrunc
-LLVMConstTruncOrBitCast
-LLVMConstUDiv
-LLVMConstUIToFP
-LLVMConstURem
-LLVMConstVector
-LLVMConstXor
-LLVMConstZExt
-LLVMConstZExtOrBitCast
-LLVMContextCreate
-LLVMContextDispose
-LLVMCopyStringRepOfTargetData
-LLVMCountBasicBlocks
-LLVMCountIncoming
-LLVMCountParamTypes
-LLVMCountParams
-LLVMCountStructElementTypes
-LLVMCreateBuilder
-LLVMCreateBuilderInContext
-LLVMCreateFunctionPassManager
-LLVMCreateFunctionPassManagerForModule
-LLVMCreateMemoryBufferWithContentsOfFile
-LLVMCreateMemoryBufferWithSTDIN
-LLVMCreateModuleProviderForExistingModule
-LLVMCreateObjectFile
-LLVMCreatePassManager
-LLVMCreateTargetData
-LLVMDeleteBasicBlock
-LLVMDeleteFunction
-LLVMDeleteGlobal
-LLVMDisposeBuilder
-LLVMDisposeMemoryBuffer
-LLVMDisposeMessage
-LLVMDisposeModule
-LLVMDisposeModuleProvider
-LLVMDisposeObjectFile
-LLVMDisposePassManager
-LLVMDisposeSectionIterator
-LLVMDisposeTargetData
-LLVMDoubleType
-LLVMDoubleTypeInContext
-LLVMDumpModule
-LLVMDumpValue
-LLVMElementAtOffset
-LLVMFP128Type
-LLVMFP128TypeInContext
-LLVMFinalizeFunctionPassManager
-LLVMFloatType
-LLVMFloatTypeInContext
-LLVMFunctionType
-LLVMGetAlignment
-LLVMGetArrayLength
-LLVMGetAttribute
-LLVMGetBasicBlockParent
-LLVMGetBasicBlocks
-LLVMGetBitcodeModule
-LLVMGetBitcodeModuleInContext
-LLVMGetBitcodeModuleProvider
-LLVMGetBitcodeModuleProviderInContext
-LLVMGetConstOpcode
-LLVMGetCurrentDebugLocation
-LLVMGetDataLayout
-LLVMGetElementType
-LLVMGetEntryBasicBlock
-LLVMGetFirstBasicBlock
-LLVMGetFirstFunction
-LLVMGetFirstGlobal
-LLVMGetFirstInstruction
-LLVMGetFirstParam
-LLVMGetFirstUse
-LLVMGetFunctionAttr
-LLVMGetFunctionCallConv
-LLVMGetGC
-LLVMGetGlobalContext
-LLVMGetGlobalParent
-LLVMGetGlobalPassRegistry
-LLVMGetIncomingBlock
-LLVMGetIncomingValue
-LLVMGetInitializer
-LLVMGetInsertBlock
-LLVMGetInstructionCallConv
-LLVMGetInstructionParent
-LLVMGetIntTypeWidth
-LLVMGetIntrinsicID
-LLVMGetLastBasicBlock
-LLVMGetLastFunction
-LLVMGetLastGlobal
-LLVMGetLastInstruction
-LLVMGetLastParam
-LLVMGetLinkage
-LLVMGetMDKindID
-LLVMGetMDKindIDInContext
-LLVMGetMetadata
-LLVMGetModuleContext
-LLVMGetNamedFunction
-LLVMGetNamedGlobal
-LLVMGetNextBasicBlock
-LLVMGetNextFunction
-LLVMGetNextGlobal
-LLVMGetNextInstruction
-LLVMGetNextParam
-LLVMGetNextUse
-LLVMGetNumOperands
-LLVMGetOperand
-LLVMGetOrInsertFunction
-LLVMGetParam
-LLVMGetParamParent
-LLVMGetParamTypes
-LLVMGetParams
-LLVMGetPointerAddressSpace
-LLVMGetPointerToGlobal
-LLVMGetPreviousBasicBlock
-LLVMGetPreviousFunction
-LLVMGetPreviousGlobal
-LLVMGetPreviousInstruction
-LLVMGetPreviousParam
-LLVMGetReturnType
-LLVMGetSection
-LLVMGetSectionContents
-LLVMGetSectionName
-LLVMGetSectionSize
-LLVMGetSections
-LLVMGetStructElementTypes
-LLVMGetTarget
-LLVMGetTypeContext
-LLVMGetTypeKind
-LLVMGetUndef
-LLVMGetUsedValue
-LLVMGetUser
-LLVMGetValueName
-LLVMGetVectorSize
-LLVMGetVisibility
-LLVMHasMetadata
-LLVMInitializeCodeGen
-LLVMInitializeFunctionPassManager
-LLVMInitializeIPA
-LLVMInitializeInstCombine
-LLVMInitializeScalarOpts
-LLVMInitializeTarget
-LLVMInitializeTransformUtils
-LLVMInitializeARMAsmParser
-LLVMInitializeMipsAsmParser
-LLVMInitializeX86AsmParser
-LLVMInitializeARMAsmPrinter
-LLVMInitializeMipsAsmPrinter
-LLVMInitializeX86AsmPrinter
-LLVMInitializeARMDisassembler
-LLVMInitializeMipsDisassembler
-LLVMInitializeX86Disassembler
-LLVMInitializeARMTarget
-LLVMInitializeMipsTarget
-LLVMInitializeX86Target
-LLVMInitializeARMTargetMC
-LLVMInitializeMipsTargetMC
-LLVMInitializeX86TargetMC
-LLVMInitializeARMTargetInfo
-LLVMInitializeMipsTargetInfo
-LLVMInitializeX86TargetInfo
-LLVMInsertBasicBlock
-LLVMInsertBasicBlockInContext
-LLVMInsertIntoBuilder
-LLVMInsertIntoBuilderWithName
-LLVMInstructionEraseFromParent
-LLVMInt16Type
-LLVMInt16TypeInContext
-LLVMInt1Type
-LLVMInt1TypeInContext
-LLVMInt32Type
-LLVMInt32TypeInContext
-LLVMInt64Type
-LLVMInt64TypeInContext
-LLVMInt8Type
-LLVMInt8TypeInContext
-LLVMIntPtrType
-LLVMIntType
-LLVMIntTypeInContext
-LLVMIsAAllocaInst
-LLVMIsAArgument
-LLVMIsABasicBlock
-LLVMIsABinaryOperator
-LLVMIsABitCastInst
-LLVMIsABranchInst
-LLVMIsACallInst
-LLVMIsACastInst
-LLVMIsACmpInst
-LLVMIsAConstant
-LLVMIsAConstantAggregateZero
-LLVMIsAConstantArray
-LLVMIsAConstantExpr
-LLVMIsAConstantFP
-LLVMIsAConstantInt
-LLVMIsAConstantPointerNull
-LLVMIsAConstantStruct
-LLVMIsAConstantVector
-LLVMIsADbgDeclareInst
-LLVMIsADbgInfoIntrinsic
-LLVMIsAExtractElementInst
-LLVMIsAExtractValueInst
-LLVMIsAFCmpInst
-LLVMIsAFPExtInst
-LLVMIsAFPToSIInst
-LLVMIsAFPToUIInst
-LLVMIsAFPTruncInst
-LLVMIsAFunction
-LLVMIsAGetElementPtrInst
-LLVMIsAGlobalAlias
-LLVMIsAGlobalValue
-LLVMIsAGlobalVariable
-LLVMIsAICmpInst
-LLVMIsAInlineAsm
-LLVMIsAInsertElementInst
-LLVMIsAInsertValueInst
-LLVMIsAInstruction
-LLVMIsAIntToPtrInst
-LLVMIsAIntrinsicInst
-LLVMIsAInvokeInst
-LLVMIsALoadInst
-LLVMIsAMemCpyInst
-LLVMIsAMemIntrinsic
-LLVMIsAMemMoveInst
-LLVMIsAMemSetInst
-LLVMIsAPHINode
-LLVMIsAPtrToIntInst
-LLVMIsAReturnInst
-LLVMIsASExtInst
-LLVMIsASIToFPInst
-LLVMIsASelectInst
-LLVMIsAShuffleVectorInst
-LLVMIsAStoreInst
-LLVMIsASwitchInst
-LLVMIsATerminatorInst
-LLVMIsATruncInst
-LLVMIsAUIToFPInst
-LLVMIsAUnaryInstruction
-LLVMIsAUndefValue
-LLVMIsAUnreachableInst
-LLVMIsAUser
-LLVMIsAVAArgInst
-LLVMIsAZExtInst
-LLVMIsConstant
-LLVMIsDeclaration
-LLVMIsFunctionVarArg
-LLVMIsGlobalConstant
-LLVMIsNull
-LLVMIsPackedStruct
-LLVMIsSectionIteratorAtEnd
-LLVMIsTailCall
-LLVMIsThreadLocal
-LLVMIsUndef
-LLVMLabelType
-LLVMLabelTypeInContext
-LLVMLinkInInterpreter
-LLVMMDNode
-LLVMMDNodeInContext
-LLVMMDString
-LLVMMDStringInContext
-LLVMMetadataTypeInContext
-LLVMModuleCreateWithName
-LLVMModuleCreateWithNameInContext
-LLVMMoveBasicBlockAfter
-LLVMMoveBasicBlockBefore
-LLVMMoveToNextSection
-LLVMOffsetOfElement
-LLVMPPCFP128Type
-LLVMPPCFP128TypeInContext
-LLVMParseBitcode
-LLVMParseBitcodeInContext
-LLVMPassManagerBuilderCreate
-LLVMPassManagerBuilderDispose
-LLVMPassManagerBuilderPopulateModulePassManager
-LLVMPassManagerBuilderSetDisableSimplifyLibCalls
-LLVMPassManagerBuilderSetDisableUnitAtATime
-LLVMPassManagerBuilderPopulateFunctionPassManager
-LLVMPassManagerBuilderSetDisableUnrollLoops
-LLVMPassManagerBuilderSetOptLevel
-LLVMPassManagerBuilderSetSizeLevel
-LLVMPassManagerBuilderUseInlinerWithThreshold
-LLVMPointerSize
-LLVMPointerType
-LLVMPositionBuilder
-LLVMPositionBuilderAtEnd
-LLVMPositionBuilderBefore
-LLVMPreferredAlignmentOfGlobal
-LLVMPreferredAlignmentOfType
-LLVMRemoveAttribute
-LLVMRemoveFunctionAttr
-LLVMRemoveInstrAttribute
-LLVMReplaceAllUsesWith
-LLVMRunFunctionPassManager
-LLVMRunPassManager
-LLVMSetAlignment
-LLVMSetCleanup
-LLVMSetCurrentDebugLocation
-LLVMSetDataLayout
-LLVMSetDebug
-LLVMSetFunctionCallConv
-LLVMSetGC
-LLVMSetGlobalConstant
-LLVMSetInitializer
-LLVMSetInstDebugLocation
-LLVMSetInstrParamAlignment
-LLVMSetInstructionCallConv
-LLVMSetLinkage
-LLVMSetMetadata
-LLVMSetModuleInlineAsm
-LLVMSetOperand
-LLVMSetParamAlignment
-LLVMSetSection
-LLVMSetTailCall
-LLVMSetTarget
-LLVMSetThreadLocal
-LLVMSetValueName
-LLVMSetVisibility
-LLVMSizeOf
-LLVMSizeOfTypeInBits
-LLVMStoreSizeOfType
-LLVMStructType
-LLVMStructTypeInContext
-LLVMTypeOf
-LLVMValueAsBasicBlock
-LLVMValueIsBasicBlock
-LLVMVectorType
-LLVMVerifyFunction
-LLVMVerifyModule
-LLVMViewFunctionCFG
-LLVMViewFunctionCFGOnly
-LLVMVoidType
-LLVMVoidTypeInContext
-LLVMWriteBitcodeToFD
-LLVMWriteBitcodeToFile
-LLVMWriteBitcodeToFileHandle
-LLVMX86FP80Type
-LLVMX86FP80TypeInContext
-LLVMX86MMXType
-LLVMX86MMXTypeInContext
-LLVMConstNamedStruct
-LLVMStructCreateNamed
-LLVMStructSetBody
-LLVMInlineAsm
-LLVMInitializePasses
-LLVMDIBuilderCreate
-LLVMDIBuilderDispose
-LLVMDIBuilderFinalize
-LLVMDIBuilderCreateCompileUnit
-LLVMDIBuilderCreateStaticVariable
-LLVMDIBuilderCreateLocalVariable
-LLVMDIBuilderCreateFunction
-LLVMDIBuilderCreateFile
-LLVMDIBuilderCreateLexicalBlock
-LLVMDIBuilderCreateBasicType
-LLVMDIBuilderCreatePointerType
-LLVMDIBuilderCreateMemberType
-LLVMDIBuilderCreateStructType
-LLVMDIBuilderGetOrCreateSubrange
-LLVMDIBuilderCreateArrayType
-LLVMDIBuilderCreateVectorType
-LLVMDIBuilderCreateSubroutineType
-LLVMDIBuilderGetOrCreateArray
-LLVMDIBuilderInsertDeclareAtEnd
-LLVMDIBuilderInsertDeclareBefore
-LLVMDIBuilderCreateEnumerator
-LLVMDIBuilderCreateEnumerationType
-LLVMDIBuilderCreateUnionType
-LLVMDIBuilderCreateTemplateTypeParameter
-LLVMDIBuilderCreateOpDeref
-LLVMDIBuilderCreateOpPlus
-LLVMDIBuilderCreateComplexVariable
-LLVMDIBuilderCreateNameSpace
-LLVMDICompositeTypeSetTypeArray
-LLVMSetUnnamedAddr
-LLVMRustAddPass
-LLVMRustAddAnalysisPasses
-LLVMRustAddLibraryInfo
-LLVMRustCreateTargetMachine
-LLVMRustRunFunctionPassManager
-LLVMRustPrintModule
-LLVMRustDisposeTargetMachine
-LLVMRustAddBuilderLibraryInfo
-LLVMRustSetLLVMOptions
-LLVMRustPrintPasses
-LLVMRustSetNormalizedTarget
-LLVMRustAddAlwaysInlinePass
-LLVMAddReturnAttribute
-LLVMRemoveReturnAttribute
-LLVMTypeToString
-LLVMAddColdAttribute
-LLVMCreateMemoryBufferWithMemoryRange
-LLVMCreateMemoryBufferWithMemoryRangeCopy
-LLVMPassManagerBuilderPopulateLTOPassManager
-LLVMRustLinkInExternalBitcode
-LLVMRustRunRestrictionPass
index dfdde5e5e4e03530b127c78a4eebeba6d95215b3..c5dc3439f2f8d78ef407b820232c1637e64b9fc1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub struct Closed01<F>(F);
+pub struct Closed01<F>(pub F);
 
 pub trait Bar { fn new() -> Self; }
 
index 9d5005324010e7cf14f6d99dd9ff5607f064adb9..a8a4c438e67343905d49322a963a57666cfdecf3 100644 (file)
@@ -8,4 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub struct A<'a>(&'a int);
+pub struct A<'a>(pub &'a int);
index f06929a5deeecb6996cf422f246af5e132138ffb..b0abde795a8ad58b3bbdbaa66ac1bf527682e64b 100644 (file)
@@ -10,5 +10,5 @@
 
 // no-prefer-dynamic
 
-#[crate_id = "collections#0.10-pre"];
+#[crate_id = "collections#0.11-pre"];
 #[crate_type = "dylib"];
index 345be34f377467874aa3d4d27501d525bfce1ffd..612ee3608e97c9f7c3ec080c0c908daaccdcfc69 100644 (file)
@@ -10,5 +10,5 @@
 
 // no-prefer-dynamic
 
-#[crate_id = "collections#0.10-pre"];
+#[crate_id = "collections#0.11-pre"];
 #[crate_type = "rlib"];
index f1a0fcffd165877514e9554835ac097b17f44a1c..e197e84442b10d23b7585f61d06ebfe2594ce2de 100644 (file)
@@ -8,4 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub struct V2<T>(T, T);
+pub struct V2<T>(pub T, pub T);
index 5724d876ef43dd8b1ae886d4c0e592034a060505..f0f1af2e3a3da9478255989cfede9ecbc0fc9ba1 100644 (file)
@@ -8,4 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub struct Wrap<A>(A);
+pub struct Wrap<A>(pub A);
index 1475b1a75a6652b3874c570fad115316a4ce7a33..5f55476427fe2fd7bdfeed380210e33a26353f03 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 
-pub struct S(());
+pub struct S(pub ());
 
 impl S {
     pub fn foo(&self) { }
index 30224912d9265666eeec2b9b7ce6cc75b463496f..5afbf4492b30d778a172cc8e838ee892526ded77 100644 (file)
@@ -161,15 +161,15 @@ pub enum Enum {
 }
 
 #[deprecated]
-pub struct DeprecatedTupleStruct(int);
+pub struct DeprecatedTupleStruct(pub int);
 #[experimental]
-pub struct ExperimentalTupleStruct(int);
+pub struct ExperimentalTupleStruct(pub int);
 #[unstable]
-pub struct UnstableTupleStruct(int);
-pub struct UnmarkedTupleStruct(int);
+pub struct UnstableTupleStruct(pub int);
+pub struct UnmarkedTupleStruct(pub int);
 #[stable]
-pub struct StableTupleStruct(int);
+pub struct StableTupleStruct(pub int);
 #[frozen]
-pub struct FrozenTupleStruct(int);
+pub struct FrozenTupleStruct(pub int);
 #[locked]
-pub struct LockedTupleStruct(int);
+pub struct LockedTupleStruct(pub int);
index 3833b549b5fc009877402bb42edeea1ec22d0e3f..60c64842c71468d5af50412fdea491abdcd958b3 100644 (file)
@@ -10,4 +10,4 @@
 
 #[crate_type="lib"];
 
-pub struct Au(int);
+pub struct Au(pub int);
diff --git a/src/test/auxiliary/privacy-tuple-struct.rs b/src/test/auxiliary/privacy-tuple-struct.rs
new file mode 100644 (file)
index 0000000..2fb9d99
--- /dev/null
@@ -0,0 +1,14 @@
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub struct A(());
+pub struct B(int);
+pub struct C(pub int, int);
+pub struct D(pub int);
index 5f445de069ca208aa1cdb3c628dbe5bb74ad36ba..4f07660779b2692c8c5a3c9647cda6017f221fd2 100644 (file)
@@ -8,6 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![no_start]
+
+extern crate green;
+extern crate rustuv;
+
 use std::task::spawn;
 use std::os;
 use std::uint;
 // Very simple spawn rate test. Spawn N tasks that do nothing and
 // return.
 
+#[start]
+fn start(argc: int, argv: **u8) -> int {
+    green::start(argc, argv, rustuv::event_loop, main)
+}
+
 fn main() {
 
     let args = os::args();
diff --git a/src/test/compile-fail/privacy5.rs b/src/test/compile-fail/privacy5.rs
new file mode 100644 (file)
index 0000000..c057236
--- /dev/null
@@ -0,0 +1,137 @@
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:privacy-tuple-struct.rs
+// ignore-fast
+
+extern crate other = "privacy-tuple-struct";
+
+mod a {
+    pub struct A(());
+    pub struct B(int);
+    pub struct C(pub int, int);
+    pub struct D(pub int);
+
+    fn test() {
+        let a = A(());
+        let b = B(2);
+        let c = C(2, 3);
+        let d = D(4);
+
+        let A(()) = a;
+        let A(_) = a;
+        match a { A(()) => {} }
+        match a { A(_) => {} }
+
+        let B(_) = b;
+        let B(_b) = b;
+        match b { B(_) => {} }
+        match b { B(_b) => {} }
+        match b { B(1) => {} B(_) => {} }
+
+        let C(_, _) = c;
+        let C(_a, _) = c;
+        let C(_, _b) = c;
+        let C(_a, _b) = c;
+        match c { C(_, _) => {} }
+        match c { C(_a, _) => {} }
+        match c { C(_, _b) => {} }
+        match c { C(_a, _b) => {} }
+
+        let D(_) = d;
+        let D(_d) = d;
+        match d { D(_) => {} }
+        match d { D(_d) => {} }
+        match d { D(1) => {} D(_) => {} }
+
+        let a2 = A;
+        let b2 = B;
+        let c2 = C;
+        let d2 = D;
+    }
+}
+
+fn this_crate() {
+    let a = a::A(()); //~ ERROR: cannot invoke tuple struct constructor
+    let b = a::B(2); //~ ERROR: cannot invoke tuple struct constructor
+    let c = a::C(2, 3); //~ ERROR: cannot invoke tuple struct constructor
+    let d = a::D(4);
+
+    let a::A(()) = a; //~ ERROR: field #1 is private
+    let a::A(_) = a;
+    match a { a::A(()) => {} } //~ ERROR: field #1 is private
+    match a { a::A(_) => {} }
+
+    let a::B(_) = b;
+    let a::B(_b) = b; //~ ERROR: field #1 is private
+    match b { a::B(_) => {} }
+    match b { a::B(_b) => {} } //~ ERROR: field #1 is private
+    match b { a::B(1) => {} a::B(_) => {} } //~ ERROR: field #1 is private
+
+    let a::C(_, _) = c;
+    let a::C(_a, _) = c;
+    let a::C(_, _b) = c; //~ ERROR: field #2 is private
+    let a::C(_a, _b) = c; //~ ERROR: field #2 is private
+    match c { a::C(_, _) => {} }
+    match c { a::C(_a, _) => {} }
+    match c { a::C(_, _b) => {} } //~ ERROR: field #2 is private
+    match c { a::C(_a, _b) => {} } //~ ERROR: field #2 is private
+
+    let a::D(_) = d;
+    let a::D(_d) = d;
+    match d { a::D(_) => {} }
+    match d { a::D(_d) => {} }
+    match d { a::D(1) => {} a::D(_) => {} }
+
+    let a2 = a::A; //~ ERROR: cannot invoke tuple struct constructor
+    let b2 = a::B; //~ ERROR: cannot invoke tuple struct constructor
+    let c2 = a::C; //~ ERROR: cannot invoke tuple struct constructor
+    let d2 = a::D;
+}
+
+fn xcrate() {
+    let a = other::A(()); //~ ERROR: cannot invoke tuple struct constructor
+    let b = other::B(2); //~ ERROR: cannot invoke tuple struct constructor
+    let c = other::C(2, 3); //~ ERROR: cannot invoke tuple struct constructor
+    let d = other::D(4);
+
+    let other::A(()) = a; //~ ERROR: field #1 is private
+    let other::A(_) = a;
+    match a { other::A(()) => {} } //~ ERROR: field #1 is private
+    match a { other::A(_) => {} }
+
+    let other::B(_) = b;
+    let other::B(_b) = b; //~ ERROR: field #1 is private
+    match b { other::B(_) => {} }
+    match b { other::B(_b) => {} } //~ ERROR: field #1 is private
+    match b { other::B(1) => {} other::B(_) => {} } //~ ERROR: field #1 is private
+
+    let other::C(_, _) = c;
+    let other::C(_a, _) = c;
+    let other::C(_, _b) = c; //~ ERROR: field #2 is private
+    let other::C(_a, _b) = c; //~ ERROR: field #2 is private
+    match c { other::C(_, _) => {} }
+    match c { other::C(_a, _) => {} }
+    match c { other::C(_, _b) => {} } //~ ERROR: field #2 is private
+    match c { other::C(_a, _b) => {} } //~ ERROR: field #2 is private
+
+    let other::D(_) = d;
+    let other::D(_d) = d;
+    match d { other::D(_) => {} }
+    match d { other::D(_d) => {} }
+    match d { other::D(1) => {} other::D(_) => {} }
+
+    let a2 = other::A; //~ ERROR: cannot invoke tuple struct constructor
+    let b2 = other::B; //~ ERROR: cannot invoke tuple struct constructor
+    let c2 = other::C; //~ ERROR: cannot invoke tuple struct constructor
+    let d2 = other::D;
+}
+
+fn main() {}
index 943af3d0437f9d60fec87f30d043552d7bf1b09c..efc6fda26e0c021a24ad2f802f313315a193c27d 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
@@ -44,7 +45,9 @@
 // check:type = f64
 // debugger:continue
 
-#[allow(unused_variable)];
+#![allow(unused_variable)]
+#![allow(dead_code)]
+
 
 static B: bool = false;
 static I: int = -1;
index 4847144c57f6a975a2f544df46ca54ac53e8b713..860a383468da111c7264f56201f2b3539d60e091 100644 (file)
@@ -14,6 +14,7 @@
 // about UTF-32 character encoding and will print a rust char as only
 // its numerical value.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 51391faed7a111b7afd4d2e234c64ff34f293594..54c2e786ac49deb1dc4e5cb22b1b90dbd6f4d6e3 100644 (file)
@@ -14,6 +14,7 @@
 // about UTF-32 character encoding and will print a rust char as only
 // its numerical value.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 7229480b2733e2436c52cb11c4134799227519c1..b570110d8d013c009ada8e3931c27747539d4bd2 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
@@ -70,7 +71,8 @@
 // debugger:print 'c-style-enum::MANUAL_THREE'
 // check:$18 = OneMillion
 
-#[allow(unused_variable)];
+#![allow(unused_variable)]
+#![allow(dead_code)]
 
 enum AutoDiscriminant {
     One,
index 5aa6caf612e6e9b56dde0aacff4cd47061caa612..75f1d779d01fdd242ea47e594ae32ba6da3b0fb5 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-win32
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 719c97a730f63ed90b3b38206287a3a2a0fc9b58..712880d50f0979959ed609e3b85782f64a2bea36 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-win32
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index bdb8416eec5ed7072c53f98f9206c84c4154ab99..041c8b5c13f2774d209f24b09b74b642eb98f44f 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-win32
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 2a3fbecad9dcb2184c587bbe549ed45aa2b6ad16..6626d75dc0c9869edd4a3a8fd0f893e8cd0c40b8 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-win32
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 5f9789ff620c053c1714ffd377a9761c46b679f8..2e1cdeccad2dd2efb6e8eed9a4d1a8fd1c74438f 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 877b6285d133dfacc1e9b750e0a9da463473de76..16b0061f25e77d53955cacb0761964d9a945f3c6 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 3e4610289ae21bc9554abb1dfd5e90846e348ecb..3bf26ae805337babd03a7ee87a93ae68d029aba2 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-win32: FIXME #10474
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index b60e5818411741f382cc6ebd66560829c024b018..0c7e2740cd78e374fb37515dbdcdd78670711569 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index ad88606d48532d85bef542ce26f532c6b6fad5ed..635a42d443e153e253e817db9094f7a50100f876 100644 (file)
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32: FIXME #13256
 // ignore-android: FIXME(#10381)
 
 // compile-flags:-g
index 5009ed15ee6c02dacc0f64389840b67a42a59f02..f2b246b643714722e78b9d5fd0d98ace5b662028 100644 (file)
@@ -1,7 +1,7 @@
 -include ../tools.mk
 
 all:
-       [ `$(RUSTC) --crate-id crate.rs` = "foo#0.10-pre" ]
+       [ `$(RUSTC) --crate-id crate.rs` = "foo#0.11-pre" ]
        [ `$(RUSTC) --crate-name crate.rs` = "foo" ]
        [ `$(RUSTC) --crate-file-name crate.rs` = "foo" ]
        [ `$(RUSTC) --crate-file-name --crate-type=lib --test crate.rs` = "foo" ]
index 71b54f6c3414cd47204720df5c8762d04a584b20..b6587aec0ad03f16e93aea84e6ada4ee4e35773f 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[crate_id = "foo#0.10-pre"];
+#[crate_id = "foo#0.11-pre"];
 
 // Querying about the crate metadata should *not* parse the entire crate, it
 // only needs the crate attributes (which are guaranteed to be at the top) be
index 7252e319372e6dab385c4fdb6f26bf751daa5f7e..edf0e195cb38ba8003272974a08397e598a9a0e5 100644 (file)
@@ -8,8 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-win32 FIXME #13259
 // ignore-fast this is executing itself
-#[no_uv];
+#![no_uv]
 
 extern crate native;
 
diff --git a/src/test/run-pass/empty-allocation-non-null.rs b/src/test/run-pass/empty-allocation-non-null.rs
new file mode 100644 (file)
index 0000000..9695296
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub fn main() {
+    assert!(Some(~()).is_some());
+
+    struct Foo;
+    assert!(Some(~Foo).is_some());
+
+    let xs: ~[()] = ~[];
+    assert!(Some(xs).is_some());
+}
index d0526b75c966cd2efaa26dcf572573432c46de73..d0f12ae7b10c63bd5107eaf35d29dd368beca711 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-fast
+// ignore-win32 dynamic_lib can read dllexported symbols only
 // ignore-linux apparently dlsym doesn't work on program symbols?
 // ignore-android apparently dlsym doesn't work on program symbols?
 // ignore-freebsd apparently dlsym doesn't work on program symbols?
index 1d65a0a5e9e8c32276be1e78d43e8c26c8932226..fb0214115083becc14d118e6fbe5c7872c49d687 100644 (file)
@@ -17,7 +17,7 @@
 #[no_std];
 extern crate std;
 extern crate zed = "std";
-extern crate bar = "std#0.10-pre";
+extern crate bar = "std#0.11-pre";
 
 
 use std::str;