Skip to content

Commit ce9220a

Browse files
committed
---
yaml --- r: 231878 b: refs/heads/auto c: 519a186 h: refs/heads/master v: v3
1 parent 924f15d commit ce9220a

File tree

12 files changed

+68
-37
lines changed

12 files changed

+68
-37
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 37b1a8762b40717375a70755a75ac8773c382d7a
11+
refs/heads/auto: 519a186773c2b972f84fd499f57ce52400bbdcf1
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn main() {
313313
}
314314
```
315315

316-
This works because Rust has a [hygienic macro system][https://en.wikipedia.org/wiki/Hygienic_macro]. Each macro expansion
316+
This works because Rust has a [hygienic macro system]. Each macro expansion
317317
happens in a distinct ‘syntax context’, and each variable is tagged with the
318318
syntax context where it was introduced. It’s as though the variable `state`
319319
inside `main` is painted a different "color" from the variable `state` inside

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn foo(mut x: i32) {
6262
# Interior vs. Exterior Mutability
6363

6464
However, when we say something is ‘immutable’ in Rust, that doesn’t mean that
65-
it’s not able to be changed: We mean something has ‘exterior mutability’. Consider,
65+
it’s not able to be changed: we mean something has ‘exterior mutability’. Consider,
6666
for example, [`Arc<T>`][arc]:
6767

6868
```rust
@@ -85,8 +85,8 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the
8585
> You may have one or the other of these two kinds of borrows, but not both at
8686
> the same time:
8787
>
88-
> * one or more references (`&T`) to a resource.
89-
> * exactly one mutable reference (`&mut T`)
88+
> * one or more references (`&T`) to a resource,
89+
> * exactly one mutable reference (`&mut T`).
9090
9191
[ownership]: ownership.html
9292
[borrowing]: references-and-borrowing.html#borrowing

branches/auto/src/doc/trpl/references-and-borrowing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ First, any borrow must last for a scope no greater than that of the owner.
159159
Second, you may have one or the other of these two kinds of borrows, but not
160160
both at the same time:
161161

162-
* one or more references (`&T`) to a resource.
163-
* exactly one mutable reference (`&mut T`)
162+
* one or more references (`&T`) to a resource,
163+
* exactly one mutable reference (`&mut T`).
164164

165165

166166
You may notice that this is very similar, though not exactly the same as,
@@ -298,8 +298,8 @@ We can’t modify `v` because it’s borrowed by the loop.
298298

299299
### use after free
300300

301-
References must live as long as the resource they refer to. Rust will check the
302-
scopes of your references to ensure that this is true.
301+
References must not live longer than the resource they refer to. Rust will
302+
check the scopes of your references to ensure that this is true.
303303

304304
If Rust didn’t check this property, we could accidentally use a reference
305305
which was invalid. For example:

branches/auto/src/librustc_back/target/dragonfly_base.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub fn opts() -> TargetOptions {
1919
linker_is_gnu: true,
2020
has_rpath: true,
2121
pre_link_args: vec!(
22-
"-L/usr/local/lib".to_string(),
23-
"-L/usr/lib/gcc47".to_string(),
2422
// GNU-style linkers will use this to omit linking to libraries
2523
// which don't actually fulfill any relocations, but only for
2624
// libraries which follow this flag. Thus, use it before

branches/auto/src/librustc_trans/trans/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ fn declare_intrinsic(ccx: &CrateContext, key: &str) -> Option<ValueRef> {
798798
if key == $name {
799799
let f = declare::declare_cfn(ccx, $name, Type::func(&[], &$ret),
800800
ccx.tcx().mk_nil());
801+
llvm::SetUnnamedAddr(f, false);
801802
ccx.intrinsics().borrow_mut().insert($name, f.clone());
802803
return Some(f);
803804
}
@@ -806,6 +807,7 @@ fn declare_intrinsic(ccx: &CrateContext, key: &str) -> Option<ValueRef> {
806807
if key == $name {
807808
let f = declare::declare_cfn(ccx, $name, Type::func(&[$($arg),*], &$ret),
808809
ccx.tcx().mk_nil());
810+
llvm::SetUnnamedAddr(f, false);
809811
ccx.intrinsics().borrow_mut().insert($name, f.clone());
810812
return Some(f);
811813
}

branches/auto/src/librustdoc/html/layout.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ r##"<!DOCTYPE html>
6262
6363
{before_content}
6464
65-
<section class="sidebar">
65+
<nav class="sidebar">
6666
{logo}
6767
{sidebar}
68-
</section>
68+
</nav>
6969
7070
<nav class="sub">
7171
<form class="search-form js-only">
@@ -83,10 +83,12 @@ r##"<!DOCTYPE html>
8383
8484
<section class="footer"></section>
8585
86-
<div id="help" class="hidden">
86+
<aside id="help" class="hidden">
8787
<div>
88+
<h1 class="hidden">Help</h1>
89+
8890
<div class="shortcuts">
89-
<h1>Keyboard Shortcuts</h1>
91+
<h2>Keyboard Shortcuts</h2>
9092
9193
<dl>
9294
<dt>?</dt>
@@ -103,7 +105,7 @@ r##"<!DOCTYPE html>
103105
</div>
104106
105107
<div class="infos">
106-
<h1>Search Tricks</h1>
108+
<h2>Search Tricks</h2>
107109
108110
<p>
109111
Prefix searches with a type followed by a colon (e.g.
@@ -123,7 +125,7 @@ r##"<!DOCTYPE html>
123125
</p>
124126
</div>
125127
</div>
126-
</div>
128+
</aside>
127129
128130
{after_content}
129131

branches/auto/src/librustdoc/html/static/main.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ h3.impl, h3.method, h4.method, h3.type, h4.type {
104104
h3.impl, h3.method, h3.type {
105105
margin-top: 15px;
106106
}
107-
h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
107+
h1, h2, h3, h4, .sidebar, a.source, .search-input, .content table :not(code)>a, .collapse-toggle {
108108
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
109109
}
110110

@@ -189,11 +189,16 @@ nav.sub {
189189
padding: 0 10px;
190190
margin-bottom: 14px;
191191
}
192-
.block h2 {
192+
.block h2, .block h3 {
193193
margin-top: 0;
194194
margin-bottom: 8px;
195195
text-align: center;
196196
}
197+
.block ul, .block li {
198+
margin: 0;
199+
padding: 0;
200+
list-style: none;
201+
}
197202

198203
.block a {
199204
display: block;
@@ -381,7 +386,7 @@ nav.main .separator {
381386
nav.sum { text-align: right; }
382387
nav.sub form { display: inline; }
383388

384-
nav, .content {
389+
nav.sub, .content {
385390
margin-left: 230px;
386391
}
387392

@@ -407,6 +412,7 @@ a {
407412
.content span.method, .content a.method, .block a.current.method { color: #8c6067; }
408413
.content span.tymethod, .content a.tymethod, .block a.current.tymethod { color: #8c6067; }
409414
.content .fnname { color: #8c6067; }
415+
.block a.current.crate { font-weight: 500; }
410416

411417
.search-input {
412418
width: 100%;
@@ -489,7 +495,7 @@ body.blur > :not(#help) {
489495
}
490496
#help dd { margin: 5px 33px; }
491497
#help .infos { padding-left: 0; }
492-
#help h1 { margin-top: 0; }
498+
#help h1, #help h2 { margin-top: 0; }
493499
#help > div div {
494500
width: 50%;
495501
float: left;

branches/auto/src/librustdoc/html/static/main.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,8 @@
773773
if (rootPath === '../') {
774774
var sidebar = $('.sidebar');
775775
var div = $('<div>').attr('class', 'block crate');
776-
div.append($('<h2>').text('Crates'));
776+
div.append($('<h3>').text('Crates'));
777+
var ul = $('<ul>').appendTo(div);
777778

778779
var crates = [];
779780
for (var crate in rawSearchIndex) {
@@ -788,9 +789,10 @@
788789
}
789790
if (rawSearchIndex[crates[i]].items[0]) {
790791
var desc = rawSearchIndex[crates[i]].items[0][3];
791-
div.append($('<a>', {'href': '../' + crates[i] + '/index.html',
792+
var link = $('<a>', {'href': '../' + crates[i] + '/index.html',
792793
'title': plainSummaryLine(desc),
793-
'class': klass}).text(crates[i]));
794+
'class': klass}).text(crates[i]);
795+
ul.append($('<li>').append(link));
794796
}
795797
}
796798
sidebar.append(div);
@@ -809,7 +811,8 @@
809811
if (!filtered) { return; }
810812

811813
var div = $('<div>').attr('class', 'block ' + shortty);
812-
div.append($('<h2>').text(longty));
814+
div.append($('<h3>').text(longty));
815+
var ul = $('<ul>').appendTo(div);
813816

814817
for (var i = 0; i < filtered.length; ++i) {
815818
var item = filtered[i];
@@ -826,9 +829,10 @@
826829
} else {
827830
path = shortty + '.' + name + '.html';
828831
}
829-
div.append($('<a>', {'href': current.relpath + path,
832+
var link = $('<a>', {'href': current.relpath + path,
830833
'title': desc,
831-
'class': klass}).text(name));
834+
'class': klass}).text(name);
835+
ul.append($('<li>').append(link));
832836
}
833837
sidebar.append(div);
834838
}

branches/auto/src/libstd/ffi/c_str.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl CString {
209209
issue = "27769")]
210210
#[deprecated(since = "1.4.0", reason = "renamed to from_raw")]
211211
pub unsafe fn from_ptr(ptr: *const libc::c_char) -> CString {
212-
CString::from_raw(ptr)
212+
CString::from_raw(ptr as *mut _)
213213
}
214214

215215
/// Retakes ownership of a CString that was transferred to C.
@@ -219,7 +219,7 @@ impl CString {
219219
/// using the pointer.
220220
#[unstable(feature = "cstr_memory", reason = "recently added",
221221
issue = "27769")]
222-
pub unsafe fn from_raw(ptr: *const libc::c_char) -> CString {
222+
pub unsafe fn from_raw(ptr: *mut libc::c_char) -> CString {
223223
let len = libc::strlen(ptr) + 1; // Including the NUL byte
224224
let slice = slice::from_raw_parts(ptr, len as usize);
225225
CString { inner: mem::transmute(slice) }
@@ -237,7 +237,7 @@ impl CString {
237237
issue = "27769")]
238238
#[deprecated(since = "1.4.0", reason = "renamed to into_raw")]
239239
pub fn into_ptr(self) -> *const libc::c_char {
240-
self.into_raw()
240+
self.into_raw() as *const _
241241
}
242242

243243
/// Transfers ownership of the string to a C caller.
@@ -250,11 +250,8 @@ impl CString {
250250
/// Failure to call `from_ptr` will lead to a memory leak.
251251
#[unstable(feature = "cstr_memory", reason = "recently added",
252252
issue = "27769")]
253-
pub fn into_raw(self) -> *const libc::c_char {
254-
// It is important that the bytes be sized to fit - we need
255-
// the capacity to be determinable from the string length, and
256-
// shrinking to fit is the only way to be sure.
257-
Box::into_raw(self.inner) as *const libc::c_char
253+
pub fn into_raw(self) -> *mut libc::c_char {
254+
Box::into_raw(self.inner) as *mut libc::c_char
258255
}
259256

260257
/// Returns the contents of this `CString` as a slice of bytes.

branches/auto/src/libstd/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ pub mod builtin {
412412
#[macro_export]
413413
macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }) }
414414

415-
/// Includes a file as a byte slice.
415+
/// Includes a file as a reference to a byte array.
416416
///
417-
/// This macro will yield an expression of type `&'static [u8]` which is
417+
/// This macro will yield an expression of type `&'static [u8; N]` which is
418418
/// the contents of the filename specified. The file is located relative to
419419
/// the current file (similarly to how modules are found),
420420
///
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags: -C no-prepopulate-passes
12+
13+
#![feature(intrinsics)]
14+
15+
extern "rust-intrinsic" {
16+
fn sqrtf32(x: f32) -> f32;
17+
}
18+
// CHECK: @llvm.sqrt.f32(float) #{{[0-9]*}}
19+
20+
fn main() {
21+
unsafe { sqrtf32(0.0f32); }
22+
}

0 commit comments

Comments
 (0)