Commit Graph

86988 Commits

Author SHA1 Message Date
Guillaume Gomez
79f02e4b33
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"!
2018-11-29 13:10:50 +01:00
Guillaume Gomez
9a5725c77a
Rollup merge of #56312 - oli-obk:const_eval_literal, r=eddyb
Deduplicate literal -> constant lowering
2018-11-29 13:10:49 +01:00
Guillaume Gomez
ad6434ecad
Rollup merge of #56294 - polyfloyd:fix-typo-ffi-doc, r=sfackler
Fix a typo in the documentation of std::ffi
2018-11-29 13:10:48 +01:00
Guillaume Gomez
e3635f2298
Rollup merge of #56289 - marius:patch-1, r=cramertj
Fix small typo in comment of thread::stack_size
2018-11-29 13:10:46 +01:00
Guillaume Gomez
87fa7dc69a
Rollup merge of #56273 - GuillaumeGomez:iterator-fnmut-missing-link, r=steveklabnik
Add missing doc link

r? @steveklabnik
2018-11-29 13:10:45 +01:00
Guillaume Gomez
2d3236c68f
Rollup merge of #56257 - mark-i-m:rustc-guide-links, r=nikomatsakis
rustc-guide has moved to rust-lang/

r? @nikomatsakis
2018-11-29 13:10:44 +01:00
Guillaume Gomez
d1b0681bd7
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`.
2018-11-29 13:10:43 +01:00
Guillaume Gomez
1b7da84e9d
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.
2018-11-29 13:10:41 +01:00
Guillaume Gomez
5bc98a731d
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
2018-11-29 13:10:40 +01:00
Guillaume Gomez
796892e0ef
Rollup merge of #56220 - estebank:suggest-lifetime-move, r=nikomatsakis
Suggest appropriate place for lifetime when declared after type arguments
2018-11-29 13:10:39 +01:00
Guillaume Gomez
40ec109888
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`).
2018-11-29 13:10:38 +01:00
Guillaume Gomez
143193be6d
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
2018-11-29 13:10:36 +01:00
Guillaume Gomez
c23e4ea8dc
Rollup merge of #56127 - rust-lang:oli-obk-patch-1, r=nikomatsakis
Update an outdated comment in mir building

r? @eddyb
2018-11-29 13:10:35 +01:00
Guillaume Gomez
3ed113cece
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.
2018-11-29 13:10:34 +01:00
Guillaume Gomez
aebf07e3eb
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.
2018-11-29 13:10:33 +01:00
Guillaume Gomez
36a4abf6e0
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)
2018-11-29 13:10:31 +01:00
Guillaume Gomez
5d395add7f
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.
2018-11-29 13:10:30 +01:00
Guillaume Gomez
8e7a8b81e8
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?
2018-11-29 13:10:28 +01:00
Guillaume Gomez
8ca3cb90b3
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.
2018-11-29 13:10:27 +01:00
Oliver Scherer
8f9a093f52 Fix another related ICE 2018-11-29 12:58:25 +01:00
yui-knk
71f643e5bf Remove not used option
`mir_stats` has not been used since 2b32cb90c7.
2018-11-29 20:33:51 +09:00
bors
147e60c5f8 Auto merge of #56313 - nikic:update-llvm, r=alexcrichton
Update LLVM

In particular this fixes #56265.

r? @alexcrichton
2018-11-29 09:36:19 +00:00
Oliver Scherer
28cc3405a8 r/\t/ / 2018-11-29 10:16:04 +01:00
Oliver Scherer
9c282b44c2 Support arbitrary slice constants for pattern deaggregation 2018-11-29 10:16:04 +01:00
Oliver Scherer
7df1d9f656 Allow constants of byte slice type as patterns 2018-11-29 10:16:03 +01:00
bors
5a03532ea9 Auto merge of #56245 - mark-i-m:stabilize_ques_kleene, r=alexcrichton
Stabilize feature `macro_at_most_once_rep`

a.k.a. `?` Kleene operator 🎉

cc #48075

r? @Centril
2018-11-29 06:44:12 +00:00
Nicholas Nethercote
64cd645d14 Split up pretty_print and print.
`pretty_print` takes a `Token` and `match`es on it. But the particular
`Token` kind is known at each call site, so this commit splits it into
five functions: `pretty_print_eof`, `pretty_print_begin`, etc.

This commit also does likewise with `print`, though there is one
callsite for `print` where the `Token` kind isn't known, so a generic
`print` has to stay (but it now just calls out to the various `print_*`
functions).
2018-11-29 17:14:57 +11:00
Nicholas Nethercote
787959c20d Use Cow in Token::String.
`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.

This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.
2018-11-29 17:12:18 +11:00
Nicholas Nethercote
deb9195e57 Remove huge_word and zero_word.
They are unused. The commit also adds some blank lines between some
methods.
2018-11-29 17:12:15 +11:00
Nicholas Nethercote
6c80f7c4fc Fix whitespace in pp.rs.
This commit converts some 2-space indents to 4-space indents.
2018-11-29 17:11:59 +11:00
bors
a49316ddc9 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.
2018-11-29 02:56:24 +00:00
Aaron Hill
9139374181
Fix Tidy error 2018-11-28 21:39:20 -05:00
Aaron Hill
5045e12bd7
Filter out self-referential projection predicates
If we end up with a projection predicate that equates a type with
itself (e.g. <T as MyType>::Value == <T as MyType>::Value), we can
run into issues if we try to add it to our ParamEnv.
2018-11-28 21:15:06 -05:00
Guillaume Gomez
afe41078ad Add arrow to the crate select box 2018-11-29 01:29:49 +01:00
bors
5f387a6032 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
2018-11-29 00:06:20 +00:00
Esteban Küber
66a2c39290 Clean up span in non-trailing .. suggestion 2018-11-28 16:05:02 -08:00
Eduard-Mihai Burtescu
51cf4e9e91 rustc_codegen_llvm: don't overalign loads of pair operands. 2018-11-29 00:37:38 +02:00
Vadim Petrochenkov
d77edb6458 resolve: Fix false-positives from lint absolute_paths_not_starting_with_crate 2018-11-28 22:57:25 +03:00
Guillaume Gomez
8062c7ae4b Add test for crate filtering 2018-11-28 19:33:33 +01:00
Guillaume Gomez
dd717deccb Add crate filtering 2018-11-28 19:33:33 +01:00
Ralf Jung
46a683111d fix futures aliasing mutable and shared ref 2018-11-28 19:30:11 +01:00
Aaron Hill
1a84d211a2
Check all substitution parameters for inference variables 2018-11-28 12:27:11 -05:00
Aaron Hill
f57247c48c
Ensure that Rusdoc discovers all necessary auto trait bounds
Fixes #50159

This commit makes several improvements to AutoTraitFinder:

* Call infcx.resolve_type_vars_if_possible before processing new
predicates. This ensures that we eliminate inference variables wherever
possible.
* Process all nested obligations we get from a vtable, not just ones
with depth=1.
  * The 'depth=1' check was a hack to work around issues processing
certain predicates. The other changes in this commit allow us to
properly process all predicates that we encounter, so the check is no
longer necessary,
* Ensure that we only display predicates *without* inference variables
to the user, and only attempt to unify predicates that *have* an
inference variable as their type.

Additionally, the internal helper method is_of_param now operates
directly on a type, rather than taking a Substs. This allows us to use
the 'self_ty' method, rather than directly dealing with Substs.
2018-11-28 12:27:11 -05:00
Oliver Scherer
afb8cba5fc Move hir::Lit -> ty::Const conversion into its own file 2018-11-28 17:15:40 +01:00
Georg Semmler
230f5d5676
rustdoc: Fix inlining reexporting bang-macros 2018-11-28 17:11:06 +01:00
Georg Semmler
50b4eefcf5
rustdoc: Fix inlining reexported custom derives 2018-11-28 17:10:21 +01:00
Lyndon Brown
c013de4f9b 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
2018-11-28 16:05:43 +00:00
Nikita Popov
2ec76e76e4 Update LLVM
In particular to pull in a fix for #56265.
2018-11-28 16:13:40 +01:00
Oliver Scherer
40412dc09a Deduplicate literal -> constant lowering 2018-11-28 16:07:30 +01:00
Masaki Hara
8cab350c85 Don't use ReErased in deferred sizedness checking. 2018-11-28 23:59:19 +09:00