Skip to content

Commit d34318d

Browse files
authored
Auto merge of #37118 - alexcrichton:rollup, r=alexcrichton
Rollup of 17 pull requests - Successful merges: #36762, #36831, #36973, #36991, #36995, #37023, #37049, #37050, #37056, #37064, #37066, #37067, #37084, #37089, #37091, #37092, #37110 - Failed merges:
2 parents 9cb0136 + 27043b1 commit d34318d

File tree

105 files changed

+1321
-945
lines changed

Some content is hidden

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

105 files changed

+1321
-945
lines changed

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,8 @@ do
16351635
("ccache gcc")
16361636
LLVM_CXX_32="ccache"
16371637
LLVM_CC_32="ccache"
1638-
LLVM_CXX_32_ARG1="clang++"
1639-
LLVM_CC_32_ARG1="clang"
1638+
LLVM_CXX_32_ARG1="g++"
1639+
LLVM_CC_32_ARG1="gcc"
16401640

16411641
LLVM_CXX_64="ccache"
16421642
LLVM_CC_64="ccache"

src/doc/reference.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,8 +2472,7 @@ The currently implemented features of the reference compiler are:
24722472
* - `default_type_parameter_fallback` - Allows type parameter defaults to
24732473
influence type inference.
24742474

2475-
* - `stmt_expr_attributes` - Allows attributes on expressions and
2476-
non-item statements.
2475+
* - `stmt_expr_attributes` - Allows attributes on expressions.
24772476

24782477
* - `type_ascription` - Allows type ascription expressions `expr: Type`.
24792478

src/libcore/any.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373

7474
use fmt;
7575
use intrinsics;
76-
use marker::Reflect;
7776

7877
///////////////////////////////////////////////////////////////////////////////
7978
// Any trait
@@ -86,7 +85,7 @@ use marker::Reflect;
8685
///
8786
/// [mod]: index.html
8887
#[stable(feature = "rust1", since = "1.0.0")]
89-
pub trait Any: Reflect + 'static {
88+
pub trait Any: 'static {
9089
/// Gets the `TypeId` of `self`.
9190
///
9291
/// # Examples
@@ -112,7 +111,7 @@ pub trait Any: Reflect + 'static {
112111
}
113112

114113
#[stable(feature = "rust1", since = "1.0.0")]
115-
impl<T: Reflect + 'static + ?Sized > Any for T {
114+
impl<T: 'static + ?Sized > Any for T {
116115
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
117116
}
118117

@@ -366,7 +365,7 @@ impl TypeId {
366365
/// }
367366
/// ```
368367
#[stable(feature = "rust1", since = "1.0.0")]
369-
pub fn of<T: ?Sized + Reflect + 'static>() -> TypeId {
368+
pub fn of<T: ?Sized + 'static>() -> TypeId {
370369
TypeId {
371370
t: unsafe { intrinsics::type_id::<T>() },
372371
}

src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
#![feature(specialization)]
9090
#![feature(staged_api)]
9191
#![feature(unboxed_closures)]
92-
#![feature(question_mark)]
92+
#![cfg_attr(stage0, feature(question_mark))]
9393
#![feature(never_type)]
9494
#![feature(prelude_import)]
9595

src/libcore/macros.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ macro_rules! debug_assert_ne {
255255
/// Helper macro for reducing boilerplate code for matching `Result` together
256256
/// with converting downstream errors.
257257
///
258+
/// Prefer using `?` syntax to `try!`. `?` is built in to the language and is
259+
/// more succinct than `try!`. It is the standard method for error propagation.
260+
///
258261
/// `try!` matches the given `Result`. In case of the `Ok` variant, the
259262
/// expression has the value of the wrapped value.
260263
///

src/libcore/marker.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,14 @@ mod impls {
587587
#[unstable(feature = "reflect_marker",
588588
reason = "requires RFC and more experience",
589589
issue = "27749")]
590+
#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")]
590591
#[rustc_on_unimplemented = "`{Self}` does not implement `Any`; \
591592
ensure all type parameters are bounded by `Any`"]
592593
pub trait Reflect {}
593594

594595
#[unstable(feature = "reflect_marker",
595596
reason = "requires RFC and more experience",
596597
issue = "27749")]
598+
#[rustc_deprecated(since = "1.14.0", reason = "Specialization makes parametricity impossible")]
599+
#[allow(deprecated)]
597600
impl Reflect for .. { }

src/libgraphviz/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
#![cfg_attr(not(stage0), deny(warnings))]
296296

297297
#![feature(str_escape)]
298-
#![feature(question_mark)]
298+
#![cfg_attr(stage0, feature(question_mark))]
299299

300300
use self::LabelText::*;
301301

src/librustc/diagnostics.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,30 +1327,6 @@ let x: i32 = "I am not a number!";
13271327
// |
13281328
// type `i32` assigned to variable `x`
13291329
```
1330-
1331-
Another situation in which this occurs is when you attempt to use the `try!`
1332-
macro inside a function that does not return a `Result<T, E>`:
1333-
1334-
```compile_fail,E0308
1335-
use std::fs::File;
1336-
1337-
fn main() {
1338-
let mut f = try!(File::create("foo.txt"));
1339-
}
1340-
```
1341-
1342-
This code gives an error like this:
1343-
1344-
```text
1345-
<std macros>:5:8: 6:42 error: mismatched types:
1346-
expected `()`,
1347-
found `core::result::Result<_, _>`
1348-
(expected (),
1349-
found enum `core::result::Result`) [E0308]
1350-
```
1351-
1352-
`try!` returns a `Result<T, E>`, and so the function must. But `main()` has
1353-
`()` as its return type, hence the error.
13541330
"##,
13551331

13561332
E0309: r##"

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,7 @@ pub fn lower_crate(sess: &Session,
9494
let _ignore = sess.dep_graph.in_ignore();
9595

9696
LoweringContext {
97-
crate_root: if std_inject::no_core(krate) {
98-
None
99-
} else if std_inject::no_std(krate) {
100-
Some("core")
101-
} else {
102-
Some("std")
103-
},
97+
crate_root: std_inject::injected_crate_name(krate),
10498
sess: sess,
10599
parent_def: None,
106100
resolver: resolver,

0 commit comments

Comments
 (0)