]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRemoved feature gate.
Alexander Regueiro [Fri, 30 Nov 2018 02:57:30 +0000 (02:57 +0000)]
Removed feature gate.

5 years agoChanged test for issue 56202 to compile-pass.
Alexander Regueiro [Fri, 30 Nov 2018 02:55:22 +0000 (02:55 +0000)]
Changed test for issue 56202 to compile-pass.

5 years agoUse opt_def_id instead of having special branch
Esteban Küber [Sun, 25 Nov 2018 15:40:26 +0000 (07:40 -0800)]
Use opt_def_id instead of having special branch

5 years agoFix ICE with feature self_struct_ctor
Esteban Küber [Sun, 25 Nov 2018 01:12:28 +0000 (17:12 -0800)]
Fix ICE with feature self_struct_ctor

5 years agoAuto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb
bors [Thu, 29 Nov 2018 19:28:21 +0000 (19:28 +0000)]
Auto merge of #49878 - dlrobertson:va_list_pt0, r=eddyb

libcore: Add VaList and variadic arg handling intrinsics

## Summary

 - Add intrinsics for `va_start`, `va_end`, `va_copy`, and `va_arg`.
 - Add `core::va_list::VaList` to `libcore`.

Part 1 of (at least) 3 for #44930

Comments and critiques are very much welcomed 😄

5 years agoAuto merge of #56298 - tromey:update-and-reenable-lldb, r=alexcrichton
bors [Thu, 29 Nov 2018 15:24:20 +0000 (15:24 +0000)]
Auto merge of #56298 - tromey:update-and-reenable-lldb, r=alexcrichton

Re-enable lldb

Commit 7215963e56 disabled lldb due to the LLVM update.  This patch
updates lldb to build against the Rust LLVM, and re-enables it.

5 years agoAuto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 29 Nov 2018 12:23:05 +0000 (12:23 +0000)]
Auto merge of #56340 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 22 pull requests

Successful merges:

 - #55391 (bootstrap: clean up a few clippy findings)
 - #56021 (avoid features_untracked)
 - #56023 (atomic::Ordering: Get rid of misleading parts of intro)
 - #56080 (Reduce the amount of bold text at doc.rlo)
 - #56114 (Enclose type in backticks for "non-exhaustive patterns" error)
 - #56124 (Fix small doc mistake on std::io::read::read_to_end)
 - #56127 (Update an outdated comment in mir building)
 - #56148 (Add rustc-guide as a submodule)
 - #56149 (Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer)
 - #56220 (Suggest appropriate place for lifetime when declared after type arguments)
 - #56223 (Make JSON output from -Zprofile-json valid)
 - #56236 (Remove unsafe `unsafe` inner function.)
 - #56255 (Update outdated code comments in StringReader)
 - #56257 (rustc-guide has moved to rust-lang/)
 - #56273 (Add missing doc link)
 - #56289 (Fix small typo in comment of thread::stack_size)
 - #56294 (Fix a typo in the documentation of std::ffi)
 - #56312 (Deduplicate literal -> constant lowering)
 - #56319 (fix futures creating aliasing mutable and shared ref)
 - #56321 (rustdoc: add bottom margin spacing to nested lists)
 - #56322 (resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`)
 - #56330 (Clean up span in non-trailing `..` suggestion)

Failed merges:

r? @ghost

5 years agoRollup merge of #56330 - estebank:cleanup-span, r=zackmdavis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:54 +0000 (13:10 +0100)]
Rollup merge of #56330 - estebank:cleanup-span, r=zackmdavis

Clean up span in non-trailing `..` suggestion

5 years agoRollup merge of #56322 - petrochenkov:edlints, r=eddyb
Guillaume Gomez [Thu, 29 Nov 2018 12:10:53 +0000 (13:10 +0100)]
Rollup merge of #56322 - petrochenkov:edlints, r=eddyb

resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`

Fixes https://github.com/rust-lang/rust/issues/56311 (stable-to-beta regression)

5 years agoRollup merge of #56321 - jnqnfe:css_nested_list_margin, r=GuillaumeGomez
Guillaume Gomez [Thu, 29 Nov 2018 12:10:52 +0000 (13:10 +0100)]
Rollup merge of #56321 - jnqnfe:css_nested_list_margin, r=GuillaumeGomez

rustdoc: add bottom margin spacing to nested lists

the current CSS for nested lists sets margin-bottom to zero, which means that a nested list is squished up against subsequent list items/paragraphs

this changes the bottom margin to .6em, same as for paragraphs

before:
![before](https://user-images.githubusercontent.com/33935229/49176291-699ba800-f342-11e8-9d33-c4acd4df2beb.png)
after:
![after](https://user-images.githubusercontent.com/33935229/49176299-6f918900-f342-11e8-90c3-aa14db195b45.png)

5 years agoRollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:50 +0000 (13:10 +0100)]
Rollup merge of #56319 - RalfJung:async-mutable-ref, r=cramertj

fix futures creating aliasing mutable and shared ref

Fixes the problem described in https://github.com/solson/miri/issues/532#issuecomment-442552764: `set_task_waker` takes a shared reference and puts a copy into the TLS (in a `NonNull`), but `get_task_waker` gets it back out as a mutable reference. That violates "mutable references must not alias anything"!

5 years agoRollup merge of #56312 - oli-obk:const_eval_literal, r=eddyb
Guillaume Gomez [Thu, 29 Nov 2018 12:10:49 +0000 (13:10 +0100)]
Rollup merge of #56312 - oli-obk:const_eval_literal, r=eddyb

Deduplicate literal -> constant lowering

5 years agoRollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfackler
Guillaume Gomez [Thu, 29 Nov 2018 12:10:48 +0000 (13:10 +0100)]
Rollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfackler

Fix a typo in the documentation of std::ffi

5 years agoRollup merge of #56289 - marius:patch-1, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:46 +0000 (13:10 +0100)]
Rollup merge of #56289 - marius:patch-1, r=cramertj

Fix small typo in comment of thread::stack_size

5 years agoRollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, r=steveklabnik
Guillaume Gomez [Thu, 29 Nov 2018 12:10:45 +0000 (13:10 +0100)]
Rollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, r=steveklabnik

Add missing doc link

r? @steveklabnik

5 years agoRollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:44 +0000 (13:10 +0100)]
Rollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakis

rustc-guide has moved to rust-lang/

r? @nikomatsakis

5 years agoRollup merge of #56255 - jasonl:update-old-documents, r=michaelwoerister
Guillaume Gomez [Thu, 29 Nov 2018 12:10:43 +0000 (13:10 +0100)]
Rollup merge of #56255 - jasonl:update-old-documents, r=michaelwoerister

Update outdated code comments in StringReader

For the detection of newlines in the lexer, this is now done in `analyze_source_file.rs`.

5 years agoRollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertj
Guillaume Gomez [Thu, 29 Nov 2018 12:10:41 +0000 (13:10 +0100)]
Rollup merge of #56236 - frewsxcv:frewsxcv-unsafe-unsafe, r=cramertj

Remove unsafe `unsafe` inner function.

Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.

To address this issue, I removed that inner function.

5 years agoRollup merge of #56223 - Mark-Simulacrum:self-profile-json, r=wesleywiser
Guillaume Gomez [Thu, 29 Nov 2018 12:10:40 +0000 (13:10 +0100)]
Rollup merge of #56223 - Mark-Simulacrum:self-profile-json, r=wesleywiser

Make JSON output from -Zprofile-json valid

r? @wesleywiser

cc https://github.com/rust-lang-nursery/rustc-perf/issues/299

5 years agoRollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:39 +0000 (13:10 +0100)]
Rollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis

Suggest appropriate place for lifetime when declared after type arguments

5 years agoRollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:38 +0000 (13:10 +0100)]
Rollup merge of #56149 - ariasuni:improve-amctime-doc, r=TimNN

Make std::os::unix/linux::fs::MetadataExt::a/m/ctime* documentation clearer

I was confused by this API so I clarified what they are doing.

I was wondering if I should try to unify more documentation and examples between `unix` and `linux` (e.g. “of the file” is used in `unix` to refer to the file these metadata is for, “of this file” in `linux`, “of the underlying file” in `std::fs::File`).

5 years agoRollup merge of #56148 - mark-i-m:rustc-guide-submodule, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:36 +0000 (13:10 +0100)]
Rollup merge of #56148 - mark-i-m:rustc-guide-submodule, r=nikomatsakis

Add rustc-guide as a submodule

Adding this as a submodule will allow two things:
- Linking to the guide from doc.rlo
- Doing a link check as part of the rust CI build

Key question: Do we want to wait for the book to be filled out more? e.g. do we ever want to move it out of the nursery?

r? @nikomatsakis

cc @steveklabnik

5 years agoRollup merge of #56127 - rust-lang:oli-obk-patch-1, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:35 +0000 (13:10 +0100)]
Rollup merge of #56127 - rust-lang:oli-obk-patch-1, r=nikomatsakis

Update an outdated comment in mir building

r? @eddyb

5 years agoRollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:34 +0000 (13:10 +0100)]
Rollup merge of #56124 - antoine-de:fix_read_to_end_doc_mistake, r=TimNN

Fix small doc mistake on std::io::read::read_to_end

The std::io::read main documentation can lead to error because the buffer is prefilled with 10 zeros that will pad the response.
Using an empty vector is better.

The `read_to_end` documentation is already correct though.

This is my first rust PR, don't hesitate to tell me if I did something wrong.

5 years agoRollup merge of #56114 - varkor:nonexhaustive-backticks, r=nikomatsakis
Guillaume Gomez [Thu, 29 Nov 2018 12:10:33 +0000 (13:10 +0100)]
Rollup merge of #56114 - varkor:nonexhaustive-backticks, r=nikomatsakis

Enclose type in backticks for "non-exhaustive patterns" error

This makes the error style consistent with the convention in error messages.

5 years agoRollup merge of #56080 - mark-i-m:patch-2, r=steveklabnik
Guillaume Gomez [Thu, 29 Nov 2018 12:10:31 +0000 (13:10 +0100)]
Rollup merge of #56080 - mark-i-m:patch-2, r=steveklabnik

Reduce the amount of bold text at doc.rlo

Currently, all of the text is either huge or small. IMHO this is hard to read, so I propose that we make the second-level headings smaller, without making them any less prominent.

# Before:

![image](https://user-images.githubusercontent.com/8827840/48737315-50447e80-ec13-11e8-8243-6211dbba1aa1.png)

# After:

![image](https://user-images.githubusercontent.com/8827840/48737258-32771980-ec13-11e8-814e-e7851954c05a.png)

5 years agoRollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepang
Guillaume Gomez [Thu, 29 Nov 2018 12:10:30 +0000 (13:10 +0100)]
Rollup merge of #56023 - vorner:doc/atomic-ordering-strip, r=@stjepang

atomic::Ordering: Get rid of misleading parts of intro

Remove the parts of atomic::Ordering's intro that wrongly claimed that
SeqCst prevents all reorderings around it.

Closes #55196

This is a (minimal) alternative to #55233.

I also wonder if it would be worth adding at least some warnings that atomics are often a footgun/hard to use correctly, similarly like `mem::transmute` or other functions have.

5 years agoRollup merge of #56021 - RalfJung:track-features, r=oli-obk
Guillaume Gomez [Thu, 29 Nov 2018 12:10:28 +0000 (13:10 +0100)]
Rollup merge of #56021 - RalfJung:track-features, r=oli-obk

avoid features_untracked

The docs say to not use `features_untracked` when we have a tcx.

@oli-obk any particular reason why the untracked version is used all over const qualification?

5 years agoRollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=TimNN
Guillaume Gomez [Thu, 29 Nov 2018 12:10:27 +0000 (13:10 +0100)]
Rollup merge of #55391 - matthiaskrgr:bootstrap_cleanup, r=TimNN

bootstrap: clean up a few clippy findings

remove useless format!()s
remove redundant field names in a few struct initializations
pass slice instead of a vector to a function
use is_empty() instead of comparisons to .len()

No functional change intended.

5 years agoAuto merge of #56313 - nikic:update-llvm, r=alexcrichton
bors [Thu, 29 Nov 2018 09:36:19 +0000 (09:36 +0000)]
Auto merge of #56313 - nikic:update-llvm, r=alexcrichton

Update LLVM

In particular this fixes #56265.

r? @alexcrichton

5 years agoAuto merge of #56245 - mark-i-m:stabilize_ques_kleene, r=alexcrichton
bors [Thu, 29 Nov 2018 06:44:12 +0000 (06:44 +0000)]
Auto merge of #56245 - mark-i-m:stabilize_ques_kleene, r=alexcrichton

Stabilize feature `macro_at_most_once_rep`

a.k.a. `?` Kleene operator :tada:

cc #48075

r? @Centril

5 years agoAuto merge of #56329 - eddyb:load-operand-overaligned, r=nikomatsakis
bors [Thu, 29 Nov 2018 02:56:24 +0000 (02:56 +0000)]
Auto merge of #56329 - eddyb:load-operand-overaligned, r=nikomatsakis

rustc_codegen_llvm: don't overalign loads of pair operands.

Counterpart to #56300, but for loads instead of stores.

5 years agoAuto merge of #56300 - nikic:issue-56267, r=eddyb
bors [Thu, 29 Nov 2018 00:06:20 +0000 (00:06 +0000)]
Auto merge of #56300 - nikic:issue-56267, r=eddyb

Fix alignment of stores to scalar pair

The alignment for the second element of a scalar pair is not the same as for the first element, make sure it is calculated correctly. This fixes #56267.

r? @eddyb

5 years agoClean up span in non-trailing `..` suggestion
Esteban Küber [Thu, 29 Nov 2018 00:05:02 +0000 (16:05 -0800)]
Clean up span in non-trailing `..` suggestion

5 years agorustc_codegen_llvm: don't overalign loads of pair operands.
Eduard-Mihai Burtescu [Wed, 28 Nov 2018 22:37:38 +0000 (00:37 +0200)]
rustc_codegen_llvm: don't overalign loads of pair operands.

5 years agoresolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`
Vadim Petrochenkov [Wed, 28 Nov 2018 19:52:58 +0000 (22:52 +0300)]
resolve: Fix false-positives from lint `absolute_paths_not_starting_with_crate`

5 years agofix futures aliasing mutable and shared ref
Ralf Jung [Wed, 28 Nov 2018 18:29:03 +0000 (19:29 +0100)]
fix futures aliasing mutable and shared ref

5 years agoMove hir::Lit -> ty::Const conversion into its own file
Oliver Scherer [Wed, 28 Nov 2018 16:15:40 +0000 (17:15 +0100)]
Move hir::Lit -> ty::Const conversion into its own file

5 years agorustdoc: add margin-bottom spacing to nested lists
Lyndon Brown [Sat, 24 Nov 2018 23:56:27 +0000 (23:56 +0000)]
rustdoc: add margin-bottom spacing to nested lists

set to zero meant that the nested list was squished up against
subsequent list items/paragraphs

this changes the bottom margin to .6em, same as for paragraphs

an example demonstrating the difference with screenshots is given in the
pull request

5 years agoUpdate LLVM
Nikita Popov [Wed, 28 Nov 2018 14:27:51 +0000 (15:27 +0100)]
Update LLVM

In particular to pull in a fix for #56265.

5 years agoDeduplicate literal -> constant lowering
Oliver Scherer [Wed, 28 Nov 2018 15:07:30 +0000 (16:07 +0100)]
Deduplicate literal -> constant lowering

5 years agofix test
Mark Mansi [Wed, 28 Nov 2018 00:21:10 +0000 (18:21 -0600)]
fix test

5 years agoFix alignment of stores to scalar pair
Nikita Popov [Tue, 27 Nov 2018 23:25:40 +0000 (00:25 +0100)]
Fix alignment of stores to scalar pair

The alignment for the second element of a scalar pair is not the
same as for the first element. Make sure it is computed correctly
based on the element size.

5 years agoAuto merge of #56293 - matthiaskrgr:clippy, r=oli-obk
bors [Tue, 27 Nov 2018 21:54:39 +0000 (21:54 +0000)]
Auto merge of #56293 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from 754b4c07 to b2601beb

Changes:
````
Fix NAIVE_BYTECOUNT applicability
Fix dogfood error
Change Applicability of MISTYPED_LITERAL_SUFFIX
Add applicability level to (nearly) every span_lint_and_sugg function
Update stderr file
Fix bugs and improve documentation
Add Applicability::Unspecified to span_lint_and_sugg functions
Introduce snippet_with_applicability and hir_with_applicability functions
readme: tell how to install clippy on travis from git if it is not shipped with a nightly.
constants: add u128 i128 builtin types and fix outdated url
Update lints
Lint only the first statment/expression after alloc
Fix some warnings related to Self
Rename some symbols
Split lint into slow and unsafe vector initalization
Add unsafe set_len initialization
Add slow zero-filled vector initialization lint
Travis: Remove `sudo: false`
Downgrade needless_pass_by_value to allow by default
````

5 years agoFix a typo in the documentation of std::ffi
polyfloyd [Tue, 27 Nov 2018 21:33:46 +0000 (22:33 +0100)]
Fix a typo in the documentation of std::ffi

5 years agosubmodules: update clippy from 754b4c07 to b2601beb
Matthias Krüger [Tue, 27 Nov 2018 20:21:57 +0000 (21:21 +0100)]
submodules: update clippy from 754b4c07 to b2601beb

Changes:
````
Fix NAIVE_BYTECOUNT applicability
Fix dogfood error
Change Applicability of MISTYPED_LITERAL_SUFFIX
Add applicability level to (nearly) every span_lint_and_sugg function
Update stderr file
Fix bugs and improve documentation
Add Applicability::Unspecified to span_lint_and_sugg functions
Introduce snippet_with_applicability and hir_with_applicability functions
readme: tell how to install clippy on travis from git if it is not shipped with a nightly.
constants: add u128 i128 builtin types and fix outdated url
Update lints
Lint only the first statment/expression after alloc
Fix some warnings related to Self
Rename some symbols
Split lint into slow and unsafe vector initalization
Add unsafe set_len initialization
Add slow zero-filled vector initialization lint
Travis: Remove `sudo: false`
Downgrade needless_pass_by_value to allow by default
````

5 years agoRe-enable lldb
Tom Tromey [Tue, 27 Nov 2018 20:06:49 +0000 (13:06 -0700)]
Re-enable lldb

Commit 7215963e56 disabled lldb due to the LLVM update.  This patch
updates lldb to build against the Rust LLVM, and re-enables it.

5 years agofix test
Mark Mansi [Sun, 25 Nov 2018 00:40:03 +0000 (18:40 -0600)]
fix test

5 years agoremove uses of feature gate
Mark Mansi [Sat, 24 Nov 2018 23:26:15 +0000 (17:26 -0600)]
remove uses of feature gate

5 years agoremove unstable book entry
Mark Mansi [Sat, 24 Nov 2018 22:29:43 +0000 (16:29 -0600)]
remove unstable book entry

5 years agoupdate tests
Mark Mansi [Sat, 24 Nov 2018 22:27:13 +0000 (16:27 -0600)]
update tests

5 years agoremove some unused vars
Mark Mansi [Sat, 24 Nov 2018 22:20:25 +0000 (16:20 -0600)]
remove some unused vars

5 years agoremove feature gate
Mark Mansi [Sat, 24 Nov 2018 22:12:16 +0000 (16:12 -0600)]
remove feature gate

5 years agomove feature gate to accepted
Mark Mansi [Sat, 24 Nov 2018 22:09:37 +0000 (16:09 -0600)]
move feature gate to accepted

5 years agoAuto merge of #56264 - petrochenkov:typonly, r=nikomatsakis
bors [Tue, 27 Nov 2018 19:04:44 +0000 (19:04 +0000)]
Auto merge of #56264 - petrochenkov:typonly, r=nikomatsakis

resolve: Extern prelude is for type namespace only

Fixes https://github.com/rust-lang/rust/issues/56263 (stable-to-beta regression)

5 years agoFix small typo in comment
Marius Nuennerich [Tue, 27 Nov 2018 17:57:55 +0000 (18:57 +0100)]
Fix small typo in comment

5 years agoAuto merge of #56251 - scalexm:root-universe, r=nikomatsakis
bors [Tue, 27 Nov 2018 15:54:21 +0000 (15:54 +0000)]
Auto merge of #56251 - scalexm:root-universe, r=nikomatsakis

Put all existential ty vars in the `ROOT` universe

r? @nikomatsakis

5 years agoavoid features_untracked
Ralf Jung [Sat, 17 Nov 2018 12:57:53 +0000 (13:57 +0100)]
avoid features_untracked

5 years agoAuto merge of #55402 - estebank:macro-eof-2, r=nikomatsakis
bors [Tue, 27 Nov 2018 12:31:45 +0000 (12:31 +0000)]
Auto merge of #55402 - estebank:macro-eof-2, r=nikomatsakis

Point at end of macro arm when encountering EOF

Fix #52866.

5 years agoresolve: Extern prelude is for type namespace only
Vadim Petrochenkov [Tue, 27 Nov 2018 00:26:37 +0000 (03:26 +0300)]
resolve: Extern prelude is for type namespace only

5 years agoAuto merge of #56094 - RalfJung:memory-data-revived, r=oli-obk
bors [Tue, 27 Nov 2018 09:30:15 +0000 (09:30 +0000)]
Auto merge of #56094 - RalfJung:memory-data-revived, r=oli-obk

miri: Memory data revived, Hooks for stack frame push/pop

r? @oli-obk

5 years agoAdd missing doc link
Guillaume Gomez [Tue, 27 Nov 2018 08:59:44 +0000 (09:59 +0100)]
Add missing doc link

5 years agoAuto merge of #56262 - petrochenkov:nabsedihyg, r=petrochenkov
bors [Tue, 27 Nov 2018 01:02:37 +0000 (01:02 +0000)]
Auto merge of #56262 - petrochenkov:nabsedihyg, r=petrochenkov

[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

5 years agotest: Add basic test for VaList
Dan Robertson [Tue, 23 Oct 2018 23:25:58 +0000 (23:25 +0000)]
test: Add basic test for VaList

5 years agolibcore: Add va_list lang item and intrinsics
Dan Robertson [Tue, 23 Oct 2018 23:13:33 +0000 (23:13 +0000)]
libcore: Add va_list lang item and intrinsics

 - Add the llvm intrinsics used to manipulate a va_list.
 - Add the va_list lang item in order to allow implementing
   VaList in libcore.

5 years agoAuto merge of #54668 - RalfJung:use-maybe-uninit, r=SimonSapin
bors [Mon, 26 Nov 2018 22:20:20 +0000 (22:20 +0000)]
Auto merge of #54668 - RalfJung:use-maybe-uninit, r=SimonSapin

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.

5 years agoSpecify suggestion applicability
Esteban Küber [Mon, 26 Nov 2018 21:58:46 +0000 (13:58 -0800)]
Specify suggestion applicability

5 years agoresolve: Suggest `crate::` for resolving ambiguities when appropriate
Vadim Petrochenkov [Sun, 25 Nov 2018 13:08:43 +0000 (16:08 +0300)]
resolve: Suggest `crate::` for resolving ambiguities when appropriate

More precise spans for ambiguities from macros

5 years agoresolve: Fallback to extern prelude in 2015 imports used from global 2018 edition
Vadim Petrochenkov [Sat, 24 Nov 2018 21:25:03 +0000 (00:25 +0300)]
resolve: Fallback to extern prelude in 2015 imports used from global 2018 edition

5 years agoresolve: Generalize `early_resolve_ident_in_lexical_scope` slightly
Vadim Petrochenkov [Sat, 24 Nov 2018 16:14:05 +0000 (19:14 +0300)]
resolve: Generalize `early_resolve_ident_in_lexical_scope` slightly

Flatten `ModuleOrUniformRoot` variants

5 years agoresolve: Fallback to uniform paths in 2015 imports used from global 2018 edition
Vadim Petrochenkov [Sat, 24 Nov 2018 12:07:03 +0000 (15:07 +0300)]
resolve: Fallback to uniform paths in 2015 imports used from global 2018 edition

5 years agoresolve: Implement edition hygiene for imports and absolute paths
Vadim Petrochenkov [Sun, 18 Nov 2018 00:25:59 +0000 (03:25 +0300)]
resolve: Implement edition hygiene for imports and absolute paths

Use per-span hygiene in a few other places in resolve
Prefer `rust_2015`/`rust_2018` helpers to comparing editions

5 years agoRemove duplicate tests for uniform paths
Vadim Petrochenkov [Thu, 22 Nov 2018 21:50:15 +0000 (00:50 +0300)]
Remove duplicate tests for uniform paths

5 years agorustc-guide has moved
Mark Mansi [Mon, 26 Nov 2018 21:03:13 +0000 (15:03 -0600)]
rustc-guide has moved

5 years agoAdd rustc-guide as a submodule
Mark Mansi [Thu, 22 Nov 2018 00:57:14 +0000 (18:57 -0600)]
Add rustc-guide as a submodule

5 years agoUpdate outdated code comments in StringReader
Jason Langenauer [Mon, 26 Nov 2018 20:21:17 +0000 (21:21 +0100)]
Update outdated code comments in StringReader

5 years agoPut all existential ty vars in the `ROOT` universe
scalexm [Mon, 26 Nov 2018 19:37:43 +0000 (20:37 +0100)]
Put all existential ty vars in the `ROOT` universe

5 years agoEmit one diagnostic for multiple misplaced lifetimes
Esteban Küber [Mon, 26 Nov 2018 16:32:47 +0000 (08:32 -0800)]
Emit one diagnostic for multiple misplaced lifetimes

5 years agoRemove unsafe `unsafe` inner function.
Corey Farwell [Mon, 26 Nov 2018 13:40:34 +0000 (08:40 -0500)]
Remove unsafe `unsafe` inner function.

Within this `Iterator` implementation, a function `unsafe_get` is
defined which unsafely allows _unchecked_ indexing of any element in a
slice. This should be marked as _unsafe_, but it is not.

To address this issue, I removed that inner function.

5 years agoAuto merge of #55835 - alexcrichton:llvm-upgrade, r=nikomatsakis
bors [Mon, 26 Nov 2018 12:14:13 +0000 (12:14 +0000)]
Auto merge of #55835 - alexcrichton:llvm-upgrade, r=nikomatsakis

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!

5 years agoAuto merge of #56070 - oli-obk:const_let, r=eddyb
bors [Mon, 26 Nov 2018 08:17:36 +0000 (08:17 +0000)]
Auto merge of #56070 - oli-obk:const_let, r=eddyb

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

5 years agoTemporarily disable LLDB
Alex Crichton [Mon, 26 Nov 2018 04:28:26 +0000 (20:28 -0800)]
Temporarily disable LLDB

5 years agoPass `--export-dynamic` to LLD for wasm
Alex Crichton [Sat, 10 Nov 2018 18:04:17 +0000 (10:04 -0800)]
Pass `--export-dynamic` to LLD for wasm

This should handle recent symbol visibility changes happening, although
we'll likely want to tweak this in the future!

5 years agowasm: Pass `--no-demangle` to LLD
Alex Crichton [Fri, 9 Nov 2018 21:51:00 +0000 (13:51 -0800)]
wasm: Pass `--no-demangle` to LLD

Our mangling scheme is not C++'s, so tell LLD to not demangle anything
so we can handle Rust-specific demangling ourselves.

5 years agoConditionally compile in only the extra argument.
Edd Barrett [Wed, 7 Nov 2018 12:34:43 +0000 (12:34 +0000)]
Conditionally compile in only the extra argument.

5 years agoMake Rustc build with LLVM trunk.
Edd Barrett [Wed, 7 Nov 2018 12:05:54 +0000 (12:05 +0000)]
Make Rustc build with LLVM trunk.

5 years agoHandle some renamed ThinLTO functions
Alex Crichton [Fri, 9 Nov 2018 21:09:32 +0000 (13:09 -0800)]
Handle some renamed ThinLTO functions

5 years agoUpgrade to LLVM trunk
Alex Crichton [Fri, 9 Nov 2018 20:54:04 +0000 (12:54 -0800)]
Upgrade to LLVM trunk

5 years agoAuto merge of #55705 - ethanboxx:master, r=SimonSapin
bors [Mon, 26 Nov 2018 01:46:18 +0000 (01:46 +0000)]
Auto merge of #55705 - ethanboxx:master, r=SimonSapin

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.

5 years agoMake JSON output from -Zprofile-json valid
Mark Rousskov [Sun, 25 Nov 2018 22:43:00 +0000 (15:43 -0700)]
Make JSON output from -Zprofile-json valid

5 years agoAuto merge of #56194 - eddyb:top-unhack, r=alexcrichton
bors [Sun, 25 Nov 2018 22:00:08 +0000 (22:00 +0000)]
Auto merge of #56194 - eddyb:top-unhack, r=alexcrichton

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.

5 years agoHACK(eddyb) Cargo.toml: also exclude the `obj` directory from the workspace.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 21:15:20 +0000 (23:15 +0200)]
HACK(eddyb) Cargo.toml: also exclude the `obj` directory from the workspace.

5 years agoCargo.toml: exclude the `build` directory from the workspace.
Eduard-Mihai Burtescu [Sun, 25 Nov 2018 12:59:52 +0000 (14:59 +0200)]
Cargo.toml: exclude the `build` directory from the workspace.

5 years agoTry to make top-level Cargo.toml work without __CARGO_TEST_ROOT.
Eduard-Mihai Burtescu [Sat, 24 Nov 2018 07:31:01 +0000 (09:31 +0200)]
Try to make top-level Cargo.toml work without __CARGO_TEST_ROOT.

5 years agoMove lifetimes before the *first* type argument
Esteban Küber [Sun, 25 Nov 2018 20:46:42 +0000 (12:46 -0800)]
Move lifetimes before the *first* type argument

5 years agoSuggest appropriate place for lifetime when declared after type arguments
Esteban Küber [Sun, 25 Nov 2018 20:41:38 +0000 (12:41 -0800)]
Suggest appropriate place for lifetime when declared after type arguments

5 years agofix missing borrow
Ethan Brierley [Sun, 25 Nov 2018 19:44:09 +0000 (19:44 +0000)]
fix missing borrow

5 years agoUse a reference rather than take ownership
Ethan Brierley [Sun, 25 Nov 2018 19:31:35 +0000 (19:31 +0000)]
Use a reference rather than take ownership

5 years agoAuto merge of #55527 - sgeisler:time-checked-add, r=sfackler
bors [Sun, 25 Nov 2018 19:01:35 +0000 (19:01 +0000)]
Auto merge of #55527 - sgeisler:time-checked-add, r=sfackler

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.

5 years agoAuto merge of #56215 - pietroalbini:rollup, r=pietroalbini
bors [Sun, 25 Nov 2018 16:08:01 +0000 (16:08 +0000)]
Auto merge of #56215 - pietroalbini:rollup, r=pietroalbini

Rollup of 14 pull requests

Successful merges:

 - #56024 (Don't auto-inline const functions)
 - #56045 (Check arg/ret sizedness at ExprKind::Path)
 - #56072 (Stabilize macro_literal_matcher)
 - #56075 (Encode a custom "producers" section in wasm files)
 - #56100 (generator fields are not necessarily initialized)
 - #56101 (Incorporate `dyn` into more comments and docs.)
 - #56144 (Fix BTreeSet and BTreeMap gdb pretty-printers)
 - #56151 (Move a flaky process test out of libstd)
 - #56170 (Fix self profiler ICE on Windows)
 - #56176 (Panic setup msg)
 - #56204 (Suggest correct enum variant on typo)
 - #56207 (Stabilize the int_to_from_bytes feature)
 - #56210 (read_c_str should call the AllocationExtra hooks)
 - #56211 ([master] Forward-ports from beta)

Failed merges:

r? @ghost