Skip to content

Commit 0510cc4

Browse files
committed
---
yaml --- r: 179708 b: refs/heads/auto c: 34afe5e h: refs/heads/master v: v3
1 parent 955a40a commit 0510cc4

File tree

110 files changed

+662
-3775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+662
-3775
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 0568422a27ce4dd9a7f2b1c71710700be54a1da4
13+
refs/heads/auto: 34afe5e193182a0029abe1ae8258f79f4cd56cd9
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,9 @@ probe CFG_GRUN grun
653653
probe CFG_FLEX flex
654654
probe CFG_BISON bison
655655
probe CFG_PANDOC pandoc
656+
probe CFG_PDFLATEX pdflatex
656657
probe CFG_XELATEX xelatex
658+
probe CFG_LUALATEX lualatex
657659
probe CFG_GDB gdb
658660
probe CFG_LLDB lldb
659661

branches/auto/mk/docs.mk

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,27 @@ else
8585
HTML_DEPS :=
8686
endif
8787

88-
# Check for xelatex
89-
90-
ifeq ($(CFG_XELATEX),)
88+
# Check for the various external utilities for the EPUB/PDF docs:
89+
90+
ifeq ($(CFG_LUALATEX),)
91+
$(info cfg: no lualatex found, deferring to xelatex)
92+
ifeq ($(CFG_XELATEX),)
93+
$(info cfg: no xelatex found, deferring to pdflatex)
94+
ifeq ($(CFG_PDFLATEX),)
95+
$(info cfg: no pdflatex found, disabling LaTeX docs)
96+
NO_PDF_DOCS = 1
97+
else
98+
CFG_LATEX := $(CFG_PDFLATEX)
99+
endif
100+
else
91101
CFG_LATEX := $(CFG_XELATEX)
92102
XELATEX = 1
93-
else
94-
$(info cfg: no xelatex found, disabling LaTeX docs)
95-
NO_PDF_DOCS = 1
103+
endif
104+
else
105+
CFG_LATEX := $(CFG_LUALATEX)
96106
endif
97107

108+
98109
ifeq ($(CFG_PANDOC),)
99110
$(info cfg: no pandoc found, omitting PDF and EPUB docs)
100111
ONLY_HTML_DOCS = 1

branches/auto/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ token : simple_token | ident | literal | symbol | whitespace token ;
157157

158158
| | | | | |
159159
|----------|----------|----------|----------|--------|
160-
| abstract | alignof | as | become | box |
160+
| abstract | alignof | as | be | box |
161161
| break | const | continue | crate | do |
162162
| else | enum | extern | false | final |
163163
| fn | for | if | impl | in |

branches/auto/src/doc/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ tools we have are really nice.
5959
[Cargo](http://crates.io) is Rust's package manager, and its website contains
6060
lots of good documentation.
6161

62-
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
62+
[The `rustdoc` manual](rustdoc.html) contains information about Rust's
63+
documentation tool.
6364

6465
# FAQs
6566

branches/auto/src/doc/reference.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.
189189

190190
| | | | | |
191191
|----------|----------|----------|----------|---------|
192-
| abstract | alignof | as | become | box |
192+
| abstract | alignof | as | be | box |
193193
| break | const | continue | crate | do |
194194
| else | enum | extern | false | final |
195195
| fn | for | if | impl | in |
@@ -381,13 +381,11 @@ character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
381381

382382
##### Byte string literals
383383

384-
A non-raw _byte string literal_ is a sequence of ASCII characters and _escapes_,
385-
preceded by the characters `U+0062` (`b`) and `U+0022` (double-quote), and
386-
followed by the character `U+0022`. If the character `U+0022` is present within
387-
the literal, it must be _escaped_ by a preceding `U+005C` (`\`) character.
388-
Alternatively, a byte string literal can be a _raw byte string literal_, defined
389-
below. A byte string literal is equivalent to a `&'static [u8]` borrowed array
390-
of unsigned 8-bit integers.
384+
A _byte string literal_ is a sequence of ASCII characters and _escapes_
385+
enclosed within two `U+0022` (double-quote) characters, with the exception of
386+
`U+0022` itself, which must be _escaped_ by a preceding `U+005C` character
387+
(`\`), or a _raw byte string literal_. It is equivalent to a `&'static [u8]`
388+
borrowed array of unsigned 8-bit integers.
391389

392390
Some additional _escapes_ are available in either byte or non-raw byte string
393391
literals. An escape starts with a `U+005C` (`\`) and continues with one of the
@@ -2016,11 +2014,6 @@ type int8_t = i8;
20162014
- `no_start` - disable linking to the `native` crate, which specifies the
20172015
"start" language item.
20182016
- `no_std` - disable linking to the `std` crate.
2019-
- `plugin` — load a list of named crates as compiler plugins, e.g.
2020-
`#![plugin(foo, bar)]`. Optional arguments for each plugin,
2021-
i.e. `#![plugin(foo(... args ...))]`, are provided to the plugin's
2022-
registrar function. The `plugin` feature gate is required to use
2023-
this attribute.
20242017

20252018
### Module-only attributes
20262019

@@ -2089,7 +2082,7 @@ On `struct`s:
20892082
remove any padding between fields (note that this is very fragile and may
20902083
break platforms which require aligned access).
20912084

2092-
### Macro-related attributes
2085+
### Macro- and plugin-related attributes
20932086

20942087
- `macro_use` on a `mod` — macros defined in this module will be visible in the
20952088
module's parent, after this module has been included.
@@ -2104,8 +2097,13 @@ On `struct`s:
21042097

21052098
- `macro_export` - export a macro for cross-crate usage.
21062099

2107-
- `no_link` on an `extern crate` — even if we load this crate for macros, don't
2108-
link it into the output.
2100+
- `plugin` on an `extern crate` — load this crate as a [compiler
2101+
plugin][plugin]. The `plugin` feature gate is required. Any arguments to
2102+
the attribute, e.g. `#[plugin=...]` or `#[plugin(...)]`, are provided to the
2103+
plugin.
2104+
2105+
- `no_link` on an `extern crate` — even if we load this crate for macros or
2106+
compiler plugins, don't link it into the output.
21092107

21102108
See the [macros section of the
21112109
book](book/macros.html#scoping-and-macro-import/export) for more information on
@@ -2356,8 +2354,8 @@ Supported traits for `derive` are:
23562354
* `FromPrimitive`, to create an instance from a numeric primitive.
23572355
* `Hash`, to iterate over the bytes in a data type.
23582356
* `Rand`, to create a random instance of a data type.
2359-
* `Show`, to format a value using the `{}` formatter.
2360-
* `Zero`, to create a zero instance of a numeric data type.
2357+
* `Debug`, to format a value using the `{:?}` formatter.
2358+
* `Copy`, for "Plain Old Data" types which can be copied by simply moving bits.
23612359

23622360
### Compiler Features
23632361

branches/auto/src/doc/trpl/compound-data-types.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ if x == y {
7272

7373
This will print `no`, because some of the values aren't equal.
7474

75-
Note that the order of the values is considered when checking for equality,
76-
so the following example will also print `no`.
77-
78-
```rust
79-
let x = (1, 2, 3);
80-
let y = (2, 1, 3);
81-
82-
if x == y {
83-
println!("yes");
84-
} else {
85-
println!("no");
86-
}
87-
```
88-
8975
One other use of tuples is to return multiple values from a function:
9076

9177
```rust

branches/auto/src/doc/trpl/plugins.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ information.
3030
extend the compiler's behavior with new syntax extensions, lint checks, etc.
3131

3232
A plugin is a dynamic library crate with a designated *registrar* function that
33-
registers extensions with `rustc`. Other crates can load these extensions using
34-
the crate attribute `#![plugin(...)]`. See the
33+
registers extensions with `rustc`. Other crates can use these extensions by
34+
loading the plugin crate with `#[plugin] extern crate`. See the
3535
[`rustc::plugin`](../rustc/plugin/index.html) documentation for more about the
3636
mechanics of defining and loading a plugin.
3737

38-
If present, arguments passed as `#![plugin(foo(... args ...))]` are not
39-
interpreted by rustc itself. They are provided to the plugin through the
40-
`Registry`'s [`args` method](../rustc/plugin/registry/struct.Registry.html#method.args).
38+
Arguments passed as `#[plugin=...]` or `#[plugin(...)]` are not interpreted by
39+
rustc itself. They are provided to the plugin through the `Registry`'s [`args`
40+
method](../rustc/plugin/registry/struct.Registry.html#method.args).
4141

4242
# Syntax extensions
4343

@@ -110,7 +110,8 @@ Then we can use `rn!()` like any other macro:
110110

111111
```ignore
112112
#![feature(plugin)]
113-
#![plugin(roman_numerals)]
113+
114+
#[plugin] extern crate roman_numerals;
114115
115116
fn main() {
116117
assert_eq!(rn!(MMXV), 2015);
@@ -218,7 +219,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
218219
Then code like
219220

220221
```ignore
221-
#![plugin(lint_plugin_test)]
222+
#[plugin] extern crate lint_plugin_test;
222223
223224
fn lintme() { }
224225
```

branches/auto/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#![feature(unboxed_closures)]
3131
#![feature(unicode)]
3232
#![feature(unsafe_destructor, slicing_syntax)]
33-
#![cfg_attr(test, feature(rand, rustc_private, test))]
33+
#![cfg_attr(test, feature(test))]
3434
#![cfg_attr(test, allow(deprecated))] // rand
3535

3636
#![feature(no_std)]

branches/auto/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub use core::str::{Lines, LinesAny, MatchIndices, SplitStr, CharRange};
8080
pub use core::str::{Split, SplitTerminator};
8181
pub use core::str::{SplitN, RSplitN};
8282
pub use core::str::{from_utf8, CharEq, Chars, CharIndices, Bytes};
83-
pub use core::str::{from_utf8_unchecked, from_c_str, ParseBoolError};
83+
pub use core::str::{from_utf8_unchecked, from_c_str};
8484
pub use unicode::str::{Words, Graphemes, GraphemeIndices};
8585

8686
/*

branches/auto/src/libcollections/vec.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,7 @@ impl<T> Vec<T> {
690690
/// Panics if the number of elements in the vector overflows a `usize`.
691691
///
692692
/// # Examples
693-
///
694-
/// ```
693+
/// ```rust
695694
/// let mut vec = vec![1, 2, 3];
696695
/// let mut vec2 = vec![4, 5, 6];
697696
/// vec.append(&mut vec2);
@@ -1003,13 +1002,8 @@ impl<T> Vec<T> {
10031002
///
10041003
/// Note that the capacity of `self` does not change.
10051004
///
1006-
/// # Panics
1007-
///
1008-
/// Panics if `at > len`.
1009-
///
10101005
/// # Examples
1011-
///
1012-
/// ```
1006+
/// ```rust
10131007
/// let mut vec = vec![1,2,3];
10141008
/// let vec2 = vec.split_off(1);
10151009
/// assert_eq!(vec, vec![1]);
@@ -1019,7 +1013,7 @@ impl<T> Vec<T> {
10191013
#[unstable(feature = "collections",
10201014
reason = "new API, waiting for dust to settle")]
10211015
pub fn split_off(&mut self, at: usize) -> Self {
1022-
assert!(at <= self.len(), "`at` out of bounds");
1016+
assert!(at < self.len(), "`at` out of bounds");
10231017

10241018
let other_len = self.len - at;
10251019
let mut other = Vec::with_capacity(other_len);

branches/auto/src/libcore/any.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! # Examples
2828
//!
2929
//! Consider a situation where we want to log out a value passed to a function.
30-
//! We know the value we're working on implements Show, but we don't know its
30+
//! We know the value we're working on implements Debug, but we don't know its
3131
//! concrete type. We want to give special treatment to certain types: in this
3232
//! case printing out the length of String values prior to their value.
3333
//! We don't know the concrete type of our value at compile time, so we need to

branches/auto/src/libcore/iter.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,13 @@ impl<A: Int> Iterator for RangeStepInclusive<A> {
26462646
macro_rules! range_exact_iter_impl {
26472647
($($t:ty)*) => ($(
26482648
#[stable(feature = "rust1", since = "1.0.0")]
2649-
impl ExactSizeIterator for ::ops::Range<$t> { }
2649+
impl ExactSizeIterator for ::ops::Range<$t> {
2650+
#[inline]
2651+
fn len(&self) -> usize {
2652+
debug_assert!(self.end >= self.start);
2653+
(self.end - self.start) as usize
2654+
}
2655+
}
26502656
)*)
26512657
}
26522658

@@ -2667,12 +2673,9 @@ impl<A: Int> Iterator for ::ops::Range<A> {
26672673

26682674
#[inline]
26692675
fn size_hint(&self) -> (usize, Option<usize>) {
2670-
if self.start >= self.end {
2671-
(0, Some(0))
2672-
} else {
2673-
let length = (self.end - self.start).to_uint();
2674-
(length.unwrap_or(0), length)
2675-
}
2676+
debug_assert!(self.end >= self.start);
2677+
let hint = (self.end - self.start).to_uint();
2678+
(hint.unwrap_or(0), hint)
26762679
}
26772680
}
26782681

branches/auto/src/libcoretest/iter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,6 @@ fn test_range() {
756756
// this test is only meaningful when sizeof uint < sizeof u64
757757
assert_eq!((uint::MAX - 1..uint::MAX).size_hint(), (1, Some(1)));
758758
assert_eq!((-10..-1).size_hint(), (9, Some(9)));
759-
assert_eq!((-1..-10).size_hint(), (0, Some(0)));
760759
}
761760

762761
#[test]

branches/auto/src/libgetopts/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub struct Matches {
195195
}
196196

197197
/// The type returned when the command line does not conform to the
198-
/// expected format. Use the `Show` implementation to output detailed
198+
/// expected format. Use the `Debug` implementation to output detailed
199199
/// information.
200200
#[derive(Clone, PartialEq, Eq, Debug)]
201201
pub enum Fail {
@@ -545,7 +545,7 @@ impl Fail {
545545
/// Convert a `Fail` enum into an error string.
546546
#[unstable(feature = "rustc_private")]
547547
#[deprecated(since = "1.0.0",
548-
reason = "use `fmt::String` (`{}` format specifier)")]
548+
reason = "use `fmt::Display` (`{}` format specifier)")]
549549
pub fn to_err_msg(self) -> String {
550550
self.to_string()
551551
}
@@ -579,7 +579,7 @@ impl fmt::Display for Fail {
579579
/// `opt_str`, etc. to interrogate results.
580580
/// # Panics
581581
///
582-
/// Returns `Err(Fail)` on failure: use the `Show` implementation of `Fail` to display
582+
/// Returns `Err(Fail)` on failure: use the `Debug` implementation of `Fail` to display
583583
/// information about it.
584584
pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
585585
let opts: Vec<Opt> = optgrps.iter().map(|x| x.long_to_short()).collect();

branches/auto/src/librustc/diagnostics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ register_diagnostics! {
126126
E0312, // lifetime of reference outlives lifetime of borrowed content
127127
E0313, // lifetime of borrowed pointer outlives lifetime of captured variable
128128
E0314, // closure outlives stack frame
129-
E0315, // cannot invoke closure outside of its lifetime
130-
E0316 // nested quantification of lifetimes
129+
E0315 // cannot invoke closure outside of its lifetime
131130
}
132131

133132
__build_diagnostic_array! { DIAGNOSTICS }

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use syntax::ast;
2626
use syntax::abi;
2727
use syntax::attr;
2828
use syntax::attr::AttrMetaMethods;
29-
use syntax::codemap::{Span, mk_sp};
29+
use syntax::codemap::{COMMAND_LINE_SP, Span, mk_sp};
3030
use syntax::parse;
3131
use syntax::parse::token::InternedString;
3232
use syntax::parse::token;
@@ -457,13 +457,13 @@ impl<'a> CrateReader<'a> {
457457
CrateOrString::Krate(c) => {
458458
(self.extract_crate_info(c).unwrap(), c.span)
459459
}
460-
CrateOrString::Str(sp, s) => {
460+
CrateOrString::Str(s) => {
461461
(CrateInfo {
462462
name: s.to_string(),
463463
ident: s.to_string(),
464464
id: ast::DUMMY_NODE_ID,
465465
should_link: true,
466-
}, sp)
466+
}, COMMAND_LINE_SP)
467467
}
468468
};
469469
let target_triple = &self.sess.opts.target_triple[];
@@ -531,7 +531,7 @@ impl<'a> CrateReader<'a> {
531531
#[derive(Copy)]
532532
pub enum CrateOrString<'a> {
533533
Krate(&'a ast::Item),
534-
Str(Span, &'a str)
534+
Str(&'a str)
535535
}
536536

537537
impl<'a> PluginMetadata<'a> {

branches/auto/src/librustc/middle/entry.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ pub fn find_entry_point(session: &Session, ast_map: &ast_map::Map) {
5050
let any_exe = session.crate_types.borrow().iter().any(|ty| {
5151
*ty == config::CrateTypeExecutable
5252
});
53-
let emit_link = session.opts.output_types.iter().any(|ty| {
54-
*ty == config::OutputTypeExe
55-
});
56-
if !any_exe || !emit_link {
53+
if !any_exe {
5754
// No need to find a main function
5855
return
5956
}

0 commit comments

Comments
 (0)