Skip to content

Commit 1996197

Browse files
committed
---
yaml --- r: 54159 b: refs/heads/dist-snap c: 113fbfc h: refs/heads/master i: 54157: 4c9a03b 54155: 45dd069 54151: 4456694 54143: 9aa2c6b v: v3
1 parent 1c98e82 commit 1996197

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: d96bbb907edf803dc2917b3e69d387f5b6657100
10+
refs/heads/dist-snap: 113fbfc795951a10f6c0b08563944bfb6a965956
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/core.rc

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,39 @@
1010

1111
/*!
1212

13-
The Rust core library
13+
# The Rust core library
1414

1515
The Rust core library provides runtime features required by the language,
1616
including the task scheduler and memory allocators, as well as library
1717
support for Rust built-in types, platform abstractions, and other commonly
1818
used features.
1919

2020
`core` includes modules corresponding to each of the integer types, each of
21-
the floating point types, the `bool` type, tuples, characters, strings,
22-
vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`), and unsafe
23-
and borrowed pointers (`ptr`). Additionally, `core` provides task management
24-
and creation (`task`), communication primitives (`comm` and `pipes`), platform
25-
abstractions (`os` and `path`), basic I/O abstractions (`io`), common traits
26-
(`cmp`, `num`, `to_str`), and complete bindings to the C standard library
27-
(`libc`).
21+
the floating point types, the `bool` type, tuples, characters, strings
22+
(`str`), vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`),
23+
and unsafe and borrowed pointers (`ptr`). Additionally, `core` provides
24+
pervasive types (`option` and `result`), task creation and communication
25+
primitives (`task`, `comm`), platform abstractions (`os` and `path`), basic
26+
I/O abstractions (`io`), common traits (`kinds`, `ops`, `cmp`, `num`,
27+
`to_str`), and complete bindings to the C standard library (`libc`).
2828

29-
`core` is linked to all crates by default and its contents imported.
30-
Implicitly, all crates behave as if they included the following prologue:
29+
# Core injection and the Rust prelude
30+
31+
`core` is imported at the topmost level of every crate by default, as
32+
if the first line of each crate was
3133

3234
extern mod core;
33-
use core::*;
35+
36+
This means that the contents of core can be accessed from from any context
37+
with the `core::` path prefix, as in `use core::vec`, `use core::task::spawn`,
38+
etc.
39+
40+
Additionally, `core` contains a `prelude` module that reexports many of the
41+
most common core modules, types and traits. The contents of the prelude are
42+
imported inte every *module* by default. Implicitly, all modules behave as if
43+
they contained the following prologue:
44+
45+
use core::prelude::*;
3446

3547
*/
3648

branches/dist-snap/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// This file is imported into every module by default.
11+
//! The Rust prelude. Imported into every module by default.
1212
1313
/* Reexported core operators */
1414

branches/dist-snap/src/libcore/unstable/lang.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,8 @@ pub unsafe fn borrow_as_imm(a: *u8) {
9999
#[lang="return_to_mut"]
100100
#[inline(always)]
101101
pub unsafe fn return_to_mut(a: *u8) {
102-
// Sometimes the box is null, if it is conditionally frozen.
103-
// See e.g. #4904.
104-
if !a.is_null() {
105-
let a: *mut BoxRepr = transmute(a);
106-
(*a).header.ref_count &= !FROZEN_BIT;
107-
}
102+
let a: *mut BoxRepr = transmute(a);
103+
(*a).header.ref_count &= !FROZEN_BIT;
108104
}
109105

110106
#[lang="check_not_borrowed"]

branches/dist-snap/src/librustc/middle/typeck/check/regionck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ pub mod guarantor {
615615
// expressions, both of which always yield a region variable, so
616616
// mk_subr should never fail.
617617
let rptr_ty = rcx.resolve_node_type(id);
618-
if !ty::type_is_error(rptr_ty) && !ty::type_is_bot(rptr_ty) {
618+
if !ty::type_is_error(rptr_ty) {
619619
let tcx = rcx.fcx.ccx.tcx;
620620
debug!("rptr_ty=%s", ty_to_str(tcx, rptr_ty));
621621
let r = ty::ty_region(tcx, span, rptr_ty);

0 commit comments

Comments
 (0)