about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2018-11-27Auto merge of #56251 - scalexm:root-universe, r=nikomatsakisbors-7/+13
Put all existential ty vars in the `ROOT` universe r? @nikomatsakis
2018-11-27Auto merge of #55402 - estebank:macro-eof-2, r=nikomatsakisbors-65/+130
Point at end of macro arm when encountering EOF Fix #52866.
2018-11-27Auto merge of #56094 - RalfJung:memory-data-revived, r=oli-obkbors-135/+258
miri: Memory data revived, Hooks for stack frame push/pop r? @oli-obk
2018-11-27Auto merge of #56262 - petrochenkov:nabsedihyg, r=petrochenkovbors-539/+645
[master] resolve: Implement edition hygiene for imports and absolute paths Forward-port of https://github.com/rust-lang/rust/pull/56053 to master. r? @ghost
2018-11-26Auto merge of #54668 - RalfJung:use-maybe-uninit, r=SimonSapinbors-52/+53
Use MaybeUninit in libcore All code by @japaric. This re-submits the second half of https://github.com/rust-lang/rust/pull/53508 (the first half is at https://github.com/rust-lang/rust/pull/54667). This is likely the one containing the perf regression.
2018-11-27resolve: Suggest `crate::` for resolving ambiguities when appropriateVadim Petrochenkov-50/+111
More precise spans for ambiguities from macros
2018-11-27resolve: Fallback to extern prelude in 2015 imports used from global 2018 ↵Vadim Petrochenkov-25/+86
edition
2018-11-27resolve: Generalize `early_resolve_ident_in_lexical_scope` slightlyVadim Petrochenkov-82/+78
Flatten `ModuleOrUniformRoot` variants
2018-11-27resolve: Fallback to uniform paths in 2015 imports used from global 2018 editionVadim Petrochenkov-37/+186
2018-11-27resolve: Implement edition hygiene for imports and absolute pathsVadim Petrochenkov-75/+226
Use per-span hygiene in a few other places in resolve Prefer `rust_2015`/`rust_2018` helpers to comparing editions
2018-11-27Remove duplicate tests for uniform pathsVadim Petrochenkov-312/+0
2018-11-26Put all existential ty vars in the `ROOT` universescalexm-7/+13
2018-11-26Auto merge of #55835 - alexcrichton:llvm-upgrade, r=nikomatsakisbors-1/+24
Upgrade LLVM to trunk, still version 8 This commit upgrades the LLVM/LLD/compiler-rt submodules used to the current trunk versions in upstream. Some activity has happened on the wasm SIMD side of things as well as LLD which we'd like to pick up!
2018-11-26Auto merge of #56070 - oli-obk:const_let, r=eddybbors-43/+382
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
2018-11-25Pass `--export-dynamic` to LLD for wasmAlex Crichton-0/+6
This should handle recent symbol visibility changes happening, although we'll likely want to tweak this in the future!
2018-11-25wasm: Pass `--no-demangle` to LLDAlex Crichton-0/+5
Our mangling scheme is not C++'s, so tell LLD to not demangle anything so we can handle Rust-specific demangling ourselves.
2018-11-25Conditionally compile in only the extra argument.Edd Barrett-7/+4
2018-11-25Make Rustc build with LLVM trunk.Edd Barrett-0/+7
2018-11-25Handle some renamed ThinLTO functionsAlex Crichton-0/+8
2018-11-25Upgrade to LLVM trunkAlex Crichton-0/+0
2018-11-26Auto merge of #55705 - ethanboxx:master, r=SimonSapinbors-1/+24
Make `ParseIntError` and `IntErrorKind` fully public Why would you write nice error types if I can't read them? # Why It can be useful to use `match` with errors produced when parsing strings to int. This would be useful for the `.err_match()` function in my [new crate](https://crates.io/crates/read_input). --- I could also do this for `ParseFloatError` if people think it is a good idea. I am new around hear so please tell me if I am getting anything wrong.
2018-11-25Auto merge of #56194 - eddyb:top-unhack, r=alexcrichtonbors-22/+11
Try to make top-level Cargo.toml work without __CARGO_TEST_ROOT. The last failures I noticed before adding the `__CARGO_TEST_ROOT` hack were in `src/test/run-make/thumb-none-{cortex-m,qemu}`, and had to do with the fact that the top-level `Cargo.toml` uses nightly Cargo features. If that's the only problem, this PR should work, and we can figure out how to unbreak RLS.
2018-11-25Try to make top-level Cargo.toml work without __CARGO_TEST_ROOT.Eduard-Mihai Burtescu-22/+11
2018-11-25fix missing borrowEthan Brierley-1/+1
2018-11-25Use a reference rather than take ownershipEthan Brierley-1/+1
2018-11-25Auto merge of #55527 - sgeisler:time-checked-add, r=sfacklerbors-22/+78
Implement checked_add_duration for SystemTime [Original discussion on the rust user forum](https://users.rust-lang.org/t/std-systemtime-misses-a-checked-add-function/21785) Since `SystemTime` is opaque there is no way to check if the result of an addition will be in bounds. That makes the `Add<Duration>` trait completely unusable with untrusted data. This is a big problem because adding a `Duration` to `UNIX_EPOCH` is the standard way of constructing a `SystemTime` from a unix timestamp. This PR implements `checked_add_duration(&self, &Duration) -> Option<SystemTime>` for `std::time::SystemTime` and as a prerequisite also for all platform specific time structs. This also led to the refactoring of many `add_duration(&self, &Duration) -> SystemTime` functions to avoid redundancy (they now unwrap the result of `checked_add_duration`). Some basic unit tests for the newly introduced function were added too. I wasn't sure which stabilization attribute to add to the newly introduced function, so I just chose `#[stable(feature = "time_checked_add", since = "1.32.0")]` for now to make it compile. Please let me know how I should change it or if I violated any other conventions. P.S.: I could only test on Linux so far, so I don't necessarily expect it to compile for all platforms.
2018-11-25Rollup merge of #56211 - petrochenkov:fwd, r=petrochenkovPietro Albini-35/+129
[master] Forward-ports from beta https://github.com/rust-lang/rust/pull/56206 + one commit from https://github.com/rust-lang/rust/pull/55884 that was accidentally missing in https://github.com/rust-lang/rust/pull/56042 due to an off-by-one mistake in commit ranges r? @ghost
2018-11-25Rollup merge of #56210 - RalfJung:c_str, r=oli-obkPietro Albini-9/+8
read_c_str should call the AllocationExtra hooks I just hope we do not have other methods that bypass `get_bytes`/`get_bytes_mut`... (looking over the file, I could not find any) r? @oli-obk
2018-11-25Rollup merge of #56207 - SimonSapin:int_to_from_bytes, r=nagisaPietro Albini-38/+14
Stabilize the int_to_from_bytes feature Fixes #52963 FCP to merge completed: https://github.com/rust-lang/rust/issues/52963#issuecomment-416548327
2018-11-25Rollup merge of #56204 - estebank:suggest-variant, r=zackmdavisPietro Albini-7/+68
Suggest correct enum variant on typo Fix #37992.
2018-11-25Rollup merge of #56170 - wesleywiser:fix_self_profiler_windows, r=estebankPietro Albini-4/+19
Fix self profiler ICE on Windows Fixes #51648
2018-11-25Rollup merge of #56151 - alexcrichton:move-out-flaky-test, r=nagisaPietro Albini-36/+25
Move a flaky process test out of libstd This test ensures that everything in `env::vars()` is inherited but that's not actually true because other tests may add env vars after we spawn the process, causing the test to be flaky! This commit moves the test to a run-pass test where it can execute in isolation. Along the way this removes a lot of the platform specificity of the test, using iteslf to print the environment instead of a foreign process.
2018-11-25Rollup merge of #56144 - tromey:Bug-55771-btreemap, r=alexcrichtonPietro Albini-63/+50
Fix BTreeSet and BTreeMap gdb pretty-printers The BTreeSet and BTreeMap gdb pretty-printers did not take the node structure into account, and consequently only worked for shallow sets. This fixes the problem by iterating over child nodes when needed. This patch avoids the current approach of implementing some of the value manipulations in debugger-indepdendent code. This was done for convenience: a type lookup was needed for the first time, and there currently are no lldb formatters for these types. Closes #55771
2018-11-25Rollup merge of #56101 - frewsxcv:frewsxcv-dyn, r=steveklabnikPietro Albini-18/+19
Incorporate `dyn` into more comments and docs. r? @rust-lang/docs
2018-11-25Rollup merge of #56100 - RalfJung:visiting-generators, r=oli-obkPietro Albini-12/+42
generator fields are not necessarily initialized Looking at the MIR we generate for generators, I think we deliberately leave fields of the generator uninitialized in ways that would be illegal if this was a normal struct (or rather, one would have to use `MaybeUninit`). Consider [this example](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=417b4a2950421b726dd7b307e9ee3bec): ```rust #![feature(generators, generator_trait)] fn main() { let generator = || { let mut x = Box::new(5); { let y = &mut *x; *y = 5; yield *y; *y = 10; } *x }; let _gen = generator; } ``` It generates the MIR ``` fn main() -> (){ let mut _0: (); // return place scope 1 { scope 3 { } scope 4 { let _2: [generator@src/main.rs:4:21: 13:6 for<'r> {std::boxed::Box<i32>, i32, &'r mut i32, ()}]; // "_gen" in scope 4 at src/main.rs:14:9: 14:13 } } scope 2 { let _1: [generator@src/main.rs:4:21: 13:6 for<'r> {std::boxed::Box<i32>, i32, &'r mut i32, ()}]; // "generator" in scope 2 at src/main.rs:4:9: 4:18 } bb0: { StorageLive(_1); // bb0[0]: scope 0 at src/main.rs:4:9: 4:18 (_1.0: u32) = const 0u32; // bb0[1]: scope 0 at src/main.rs:4:21: 13:6 // ty::Const // + ty: u32 // + val: Scalar(Bits { size: 4, bits: 0 }) // mir::Constant // + span: src/main.rs:4:21: 13:6 // + ty: u32 // + literal: Const { ty: u32, val: Scalar(Bits { size: 4, bits: 0 }) } StorageLive(_2); // bb0[2]: scope 1 at src/main.rs:14:9: 14:13 _2 = move _1; // bb0[3]: scope 1 at src/main.rs:14:16: 14:25 drop(_2) -> bb1; // bb0[4]: scope 1 at src/main.rs:15:1: 15:2 } bb1: { StorageDead(_2); // bb1[0]: scope 1 at src/main.rs:15:1: 15:2 StorageDead(_1); // bb1[1]: scope 0 at src/main.rs:15:1: 15:2 return; // bb1[2]: scope 0 at src/main.rs:15:2: 15:2 } } ``` Notice how we only initialize the first field of `_1` (even though it contains a `Box`!), and then assign it to `_2`. This violates the rule "on assignment, all data must satisfy the validity invariant", and hence miri complains about this code. What this PR effectively does is to change the validity invariant for generators such that it says nothing about the fields of the generator. We behave as if every field of the generator was wrapped in a `MaybeUninit`. r? @oli-obk Cc @nikomatsakis @eddyb @cramertj @withoutboats @Zoxc
2018-11-25Rollup merge of #56075 - alexcrichton:wasm-producer-section, r=estebankPietro Albini-0/+112
Encode a custom "producers" section in wasm files This commit implements WebAssembly/tool-conventions#65 for wasm files produced by the Rust compiler. This adds a bit of metadata to wasm modules to indicate that the file's language includes Rust and the file's "processed-by" tools includes rustc. The thinking with this section is to eventually have telemetry in browsers tracking all this.
2018-11-25Rollup merge of #56072 - da-x:stabilize-literal-matcher, r=petrochenkovPietro Albini-73/+15
Stabilize macro_literal_matcher This followed FCP in #35625. Closes #35625
2018-11-25Rollup merge of #56045 - qnighy:additional-sizedness, r=cramertjPietro Albini-46/+133
Check arg/ret sizedness at ExprKind::Path This PR solves three problems: - #50940: ICE on casting unsized tuple struct constructors - Unsized tuple struct constructors were callable in presence of `unsized_locals`. - https://github.com/rust-lang/rust/issues/48055#issuecomment-437178966: we cannot relax `Sized` bounds on stable functions because of fn ptr casting These are caused by lack of `Sized`ness checks for arguments/retvals at **reference sites of `FnDef` items** (not call sites of the functions). Therefore we can basically add more `Sized` obligations on typeck. However, adding `Sized` obligations arbitrarily breaks type inference; to prevent that I added a new method `require_type_is_sized_deferred` which doesn't interfere usual type inference.
2018-11-25Rollup merge of #56024 - oli-obk:const_fn_collect_inner, r=michaelwoeristerPietro Albini-33/+52
Don't auto-inline const functions fixes #53451
2018-11-25resolve: Fix some more asserts in import validationVadim Petrochenkov-26/+63
2018-11-25resolve: Fix bad span arithmetics in import conflict diagnosticsVadim Petrochenkov-8/+25
2018-11-25resolve: Prohibit relative paths in visibilities on 2018 editionVadim Petrochenkov-1/+41
2018-11-25TypoOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+1
Co-Authored-By: RalfJung <post@ralfj.de>
2018-11-25Auto merge of #55906 - nnethercote:rm-OpenSnapshot-CommittedSnapshot, ↵bors-115/+93
r=nikomatsakis Clean up and streamline snapshot data structures These commits clean up the snapshot structures a bit, so they are more consistent with each other and with the `ena` crate. They also remove the `OpenSnapshot` and `CommittedSnapshot` entries in the undo log, just like I did for the `ena` crate in https://github.com/rust-lang-nursery/ena/pull/14. This PR in combination with that `ena` PR reduces instruction counts by up to 6% on benchmarks. r? @nikomatsakis. Note that this isn't quite ready for landing, because the `ena` dependency in the first commit needs to be updated once https://github.com/rust-lang-nursery/ena/pull/14 lands. But otherwise it should be good.
2018-11-25fix length of slice returned from read_c_strRalf Jung-3/+5
2018-11-25yay for NLLRalf Jung-5/+3
2018-11-25read_c_str should call the AllocationExtra hooksRalf Jung-4/+3
2018-11-25TypoOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer-1/+1
Co-Authored-By: RalfJung <post@ralfj.de>
2018-11-25accept undef in raw pointers, for consistency with integersRalf Jung-6/+10
2018-11-25machine hooks for stack push and pop, frame machine dataRalf Jung-8/+49