Commit Graph

93857 Commits

Author SHA1 Message Date
Richard Wiedenhöft
a7a05203f1 Mark core::alloc::Layout::from_size_align_unchecked const 2019-05-14 09:40:10 +02:00
Scott McMurray
7171bd1f69 README: Mention MSVC 2017+, not 2013(!)
LLVM will soon require 2017+ [1] (and our in-tree version just rejected the version of 2015 I was using), so update the mention and provide a link.

[1]: https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library
2019-05-13 23:17:54 -07:00
bors
80e7cde223 Auto merge of #60794 - Centril:rollup-vlguvns, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #60176 (Explain error when yielding a reference to a local variable)
 - #60201 (coretest: Downgrade deny to warn)
 - #60562 (Add #[doc(hidden)] attribute on compiler generated module.)
 - #60710 (Use `delay_span_bug` for error cases when checking `AnonConst` parent)
 - #60770 (add impl_trait_in_bindings to INCOMPLETE_FEATURES)

Failed merges:

r? @ghost
2019-05-14 03:09:46 +00:00
Wesley Wiser
ea93215576 Bump measureme dependency to 0.3
measureme@0.3 adds a version header to the binary file format which will
help reduce tool breakage in the future.
2019-05-13 22:15:55 -04:00
Benjamin Schultzer
58c6a94f00 Improve the "must use" lint for Future
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-05-13 16:01:20 -07:00
Andy Russell
01bc58c5ee
remove compiletest's dependency on filetime 2019-05-13 17:42:55 -04:00
Nathan Froyd
7e94f9c72e default to $ARCH-apple-macosx10.7.0 LLVM triple for darwin targets
Over in #60378, we made `rustc` switch LLVM target triples dynamically
based on the `MACOSX_DEPLOYMENT_TARGET` environment variable.  This
change was made to align with `clang`'s behavior, and therefore make
cross-language LTO feasible on OS X.  Otherwise, `rustc` would produce
LLVM bitcode files with a target triple of `x86_64-apple-darwin`,
`clang` would produce LLVM bitcode files with a target triple of
`x86_64-apple-macosx$VERSION`, and the linker would complain.

This change worked fine, except for one corner case: if you didn't have
`MACOSX_DEPLOYMENT_TARGET` set, and you wanted to do LTO on just Rust
code, you'd get warning messages similar to:

```
warning: Linking two modules of different target triples: ' is 'x86_64-apple-macosx10.7.0' whereas 'main.7rcbfp3g-cgu.4' is 'x86_64-apple-darwin'
```

This message occurs because libstd is compiled with
`MACOSX_DEPLOYMENT_TARGET` set to 10.7.  The LLVM bitcode distributed in
libstd's rlibs, then, is tagged with the target triple of
`x86_64-apple-macosx10.7.0`, while the bitcode `rustc` produces for
"user" code is tagged with the target triple of `x86_64-apple-darwin`.

It's not good to have LTO on just Rust code (probably much more common
than cross-language LTO) warn by default.  These warnings also break
Cargo's testsuite.

This change defaults to acting as though `MACOSX_DEPLOYMENT_TARGET` was
set to 10.7.  "user" code will then be given a target triple that is
equivalent to the target triple libstd bitcode is already using.  The
above warning will therefore go away.

`rustc` already assumes that compiling without
`MACOSX_DEPLOYMENT_TARGET` means that we're compiling for a target
compatible with OS X 10.7 (e.g. that things like TLS work properly).  So
this change is really just making things conform more closely to the
status quo.

(It's also worth noting that before and after this patch, compiling with
`MACOSX_DEPLOYMENT_TARGET` set to, say, 10.9, works just fine: target
triples with an "apple" version ignore OS versions when checking
compatibility, so bitcode with a `x86_64-apple-macosx10.7.0` triple works just
fine with bitcode with a `x86_64-apple-macosx10.9.0` triple.)
2019-05-13 17:04:59 -04:00
Matthew Jasper
36fd00e81c Allow late bound regions in existential types 2019-05-13 21:57:20 +01:00
Ralf Jung
43207cada2 update miri 2019-05-13 22:08:25 +02:00
Mazdak Farrokhzad
b698609624
Rollup merge of #60770 - Pulkit07:issue60764, r=Centril
add impl_trait_in_bindings to INCOMPLETE_FEATURES

impl_trait_in_bindings is not yet complete and can lead to compiler crashes.

Fixes #60764.
2019-05-13 21:36:55 +02:00
Mazdak Farrokhzad
25b5d30163
Rollup merge of #60710 - varkor:delay_span_bug-const-parent, r=matthewjasper
Use `delay_span_bug` for error cases when checking `AnonConst` parent

Fixes #60704.
Fixes #60650.
2019-05-13 21:36:54 +02:00
Mazdak Farrokhzad
e952b52a16
Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichton
Add #[doc(hidden)] attribute on compiler generated module.

Resolves unavoidable `missing_docs` warning/error on proc-macro crates.
Resolves #42008.

Changes not yet tested locally, however I wanted to submit first since `rustc` takes forever to compile.
2019-05-13 21:36:52 +02:00
Mazdak Farrokhzad
c8ef512480
Rollup merge of #60201 - RalfJung:core-tests, r=alexcrichton
coretest: Downgrade deny to warn

The `deny` causes a build failure in https://github.com/RalfJung/miri-test-libstd. Since we use `-D warnings` for rustc builds, `warn` should be enough to lead to compile errors here, without impeding external builds.
2019-05-13 21:36:51 +02:00
Mazdak Farrokhzad
2821329c34
Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelix
Explain error when yielding a reference to a local variable

Closes #56508
2019-05-13 21:36:49 +02:00
Pulkit Goyal
ea956e3ae9 add impl_trait_in_bindings to INCOMPLETE_FEATURES
impl_trait_in_bindings is not yet complete and can lead to compiler crashes.

Fixes #60764.
2019-05-13 18:45:20 +03:00
Pietro Albini
3db667a819
add release notes for rust 1.34.2 2019-05-13 17:44:24 +02:00
Alex Crichton
c47e2ef8d4 Destabilize the Error::type_id function
This commit destabilizes the `Error::type_id` function in the standard library.
This does so by effectively reverting #58048, restoring the `#[unstable]`
attribute. The security mailing list has recently been notified of a
vulnerability relating to the stabilization of this function. First stabilized
in Rust 1.34.0, a stable function here allows users to implement a custom
return value for this function:

    struct MyType;

    impl Error for MyType {
	fn type_id(&self) -> TypeId {
	    // Enable safe casting to `String` by accident.
	    TypeId::of::<String>()
	}
    }

This, when combined with the `Error::downcast` family of functions, allows
safely casting a type to any other type, clearly a memory safety issue! A
security announcement will be shortly posted to the security mailing list as
well as the Rust Blog, and when those links are available they'll be filled in
for this PR as well.

This commit simply destabilizes the `Error::type_id` which, although breaking
for users since Rust 1.34.0, is hoped to have little impact and has been deemed
sufficient to mitigate this issue for the stable channel. The long-term fate of
the `Error::type_id` API will be discussed at #60784.
2019-05-13 08:18:37 -07:00
Pietro Albini
4965ffdb7a
Update src/bootstrap/util.rs
Co-Authored-By: Jake Goulding <shepmaster@mac.com>
2019-05-13 15:19:29 +02:00
Aleksey Kladov
e249f2e526 move raw span to tt reader
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for
explanation how jointness checking works with *next* pair
2019-05-13 14:54:34 +03:00
Aleksey Kladov
b91e0a3786 move span and token to tt reader 2019-05-13 14:54:34 +03:00
Aleksey Kladov
d29f0d23c3 Move token tree related lexer state to a separate struct
We only used a bunch of fields when tokenizing into a token tree,
so let's move them out of the base lexer
2019-05-13 14:54:34 +03:00
Felix S Klock II
decd6d3660
modify comment
modify the comment on `in_cycle` to reflect changes requested by ariel and myself.
2019-05-13 13:29:49 +02:00
bors
a9ec99f420 Auto merge of #60649 - Xanewok:save-analysis-assoc-const-ice, r=oli-obk
save-analysis: Fix ICE when processing associated constant

Closes #59134
Closes https://github.com/rust-lang/rls/issues/1449

Thanks @swgillespie for helping tracking this down and fixing it!

r? @eddyb
2019-05-13 10:57:59 +00:00
Ralf Jung
4cf2379f61 Revert "use SecRandomCopyBytes on macOS in Miri"
This reverts commit 54aefc6a2d.
2019-05-13 11:34:11 +02:00
Marcel Hellwig
cc314b066a Remove bitrig support from rust 2019-05-13 11:09:06 +02:00
Pietro Albini
807b7dd786
ci: disable builders not useful during the evaluation 2019-05-13 10:15:16 +02:00
Pietro Albini
694ea7646a
ci: remove links to johnterickson repo 2019-05-13 10:15:16 +02:00
Pietro Albini
da949780f0
ci: remove trailing whitespaces from azure config 2019-05-13 10:15:16 +02:00
Pietro Albini
5db55e6fe0
ci: disable toolstate commits on azure 2019-05-13 10:15:16 +02:00
Pietro Albini
06bc0da65c
ci: remove test configuration 2019-05-13 10:15:16 +02:00
bors
69ef8fbe70 Auto merge of #60765 - matthewjasper:fix-more-escaping-rescopes, r=oli-obk
Fix more escaping ReScopes

Closes #58840
2019-05-13 08:13:01 +00:00
Pietro Albini
94f7660ab3
ci: re-enable fds-are-cloexec test on macOS 2019-05-13 10:07:55 +02:00
Pietro Albini
aab0bb47fa
ci: merge the i1686-gnu images 2019-05-13 10:07:55 +02:00
Pietro Albini
7dfd8ceb4f
ci: remove fanout from the azure pipelines config 2019-05-13 10:07:55 +02:00
Pietro Albini
869ddd8d00
ci: still use aws for caches 2019-05-13 10:07:50 +02:00
Aaron Hill
476ea9ef1c
Always try to project predicates when finding auto traits in rustdoc
Fixes #60726

Previous, AutoTraitFinder would only try to project predicates when the
predicate type contained an inference variable. When finding auto
traits, we only project to try to unify inference variables - we don't
otherwise learn any new information about the required bounds.

However, this lead to failing to properly generate a negative auto trait
impl (indicating that a type never implements a certain auto trait) in
the following unusual scenario:

In almost all cases, a type has an (implicit) negative impl of an auto
trait due some other type having an explicit *negative* impl of that
auto trait. For example:

struct MyType<T> {
    field: *const T
}

has an implicit 'impl<T> !Send for MyType<T>', due to the explicit
negative impl (in libcore) 'impl<T: ?Sized> !Send for *const T'.

However, as exposed by the 'abi_stable' crate, this isn't always the
case. This minimzed example shows how a type can never implement
'Send', due to a projection error:

```
pub struct True;
pub struct False;

pub trait MyTrait {
    type Project;
}

pub struct MyStruct<T> {
    field: T
}

impl MyTrait for u8 {
    type Project = False;
}

unsafe impl<T> Send for MyStruct<T>
    where T: MyTrait<Project=True> {}

pub struct Wrapper {
    inner: MyStruct<u8>
}
```

In this example, `<u8 as MyTrait>::Project == True'
must hold for 'MyStruct<u8>: Send' to hold.
However, '<u8 as MyTrait>::Project == False' holds instead

To properly account for this unusual case, we need to call
'poly_project_and_unify' on *all* predicates, not just those with
inference variables. This ensures that we catch the projection error
that occurs above, and don't incorrectly determine that 'Wrapper: Send'
holds.
2019-05-13 01:52:04 -04:00
bors
fe5f42cdb8 Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov
Use `Symbol` more

A `Symbol` can be equated with a string (e.g. `&str`). This involves a
TLS lookup to get the chars (and a Mutex lock in a parallel compiler)
and then a char-by-char comparison. This functionality is convenient but
avoids one of the main benefits of `Symbol`s, which is fast equality
comparisons.

This PR removes the `Symbol`/string equality operations, forcing a lot
of existing string occurrences to become `Symbol`s. Fortunately, these
are almost all static strings (many are attribute names) and we can add
static `Symbol`s as necessary, and very little extra interning occurs.
The benefits are (a) a slight speedup (possibly greater in a parallel
compiler), and (b) the code is a lot more principled about `Symbol` use.
The main downside is verbosity, particularly with more `use
syntax::symbol::symbols` items.

r? @Zoxc
2019-05-13 00:28:38 +00:00
Nicholas Nethercote
ea9fac5687 Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
Nicholas Nethercote
999c1fc281 Remove the equality operation between Symbol and strings.
And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.
2019-05-13 09:31:30 +10:00
Nicholas Nethercote
fb084a48e2 Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
Nicholas Nethercote
79602c87b5 Rename syntax::symbol::symbols as syntax::symbol::sym.
Because it's going to be used a lot.
2019-05-13 09:26:43 +10:00
Nicholas Nethercote
a8245f5a38 Add lots of static Symbols.
These will be used in the subsequent commits. Many of them are
attributes.

The commit also adds the ability to handle symbols that aren't
identifiers (e.g. "proc-macro").
2019-05-13 09:26:43 +10:00
Eric Huss
e392db6cd4 Update rustc book CLI docs. 2019-05-12 14:16:50 -07:00
bors
4443957f27 Auto merge of #60767 - Centril:rollup-4cbsb73, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #60694 (Fix HIR printing of existential type #60662)
 - #60750 (syntax: Remove some legacy nonterminal tokens)
 - #60751 (Assorted cleanup in parser & AST validation)
 - #60752 (Fix minor typos for ItemLocalId)

Failed merges:

r? @ghost
2019-05-12 20:28:19 +00:00
Mazdak Farrokhzad
b381e52c7c
Rollup merge of #60752 - shiatsumat:minor-typos-hir, r=wesleywiser
Fix minor typos for ItemLocalId

* added comma after 'that is'
* "can be implement" -> "can be implemented"
2019-05-12 21:14:11 +02:00
Mazdak Farrokhzad
c0aeaa1bfd
Rollup merge of #60751 - Centril:general-cleanup, r=petrochenkov
Assorted cleanup in parser & AST validation

r? @petrochenkov

Extracted out of a larger PR.
2019-05-12 21:14:10 +02:00
Mazdak Farrokhzad
d11b6be6b9
Rollup merge of #60750 - petrochenkov:noquotok2, r=Mark-Simulacrum
syntax: Remove some legacy nonterminal tokens

They were used by legacy quote macros removed in https://github.com/rust-lang/rust/pull/51285.
2019-05-12 21:14:08 +02:00
Mazdak Farrokhzad
8327517946
Rollup merge of #60694 - Pulkit07:issue60662, r=alexreg
Fix HIR printing of existential type #60662

This fixes https://github.com/rust-lang/rust/issues/60662
2019-05-12 21:14:07 +02:00
Matthew Jasper
9a4f0abd7a Don't allow any ReScope in impl trait types
This shouldn't be possible any more, but if it does happen, emit an
error rather than maybe panicking later when NLL finds a the ReScope.
Impl trait in bindings is sufficiently broken that I don't think this
breaks anything that works for it.
2019-05-12 18:51:40 +01:00
Matthew Jasper
be5fe051a8 Remove feature(nll) when compare mode is sufficient 2019-05-12 18:46:43 +01:00