Vadim Petrochenkov
cfd762954b
resolve: Tweak some articles in ambiguity diagnostics
2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
cfe81559ee
resolve: Recover "did you mean" suggestions in imports
2018-11-18 13:57:01 +03:00
Vadim Petrochenkov
4c5d822a8b
resolve: Check resolution consistency for import paths and multi-segment macro paths
2018-11-18 13:55:58 +03:00
Vadim Petrochenkov
07af4ec7a2
resolve: Resolve single-segment imports using in-scope resolution on 2018 edition
2018-11-18 13:51:43 +03:00
Vadim Petrochenkov
1cfd08c0c4
resolve: More precise determinacy tracking during import/macro resolution
2018-11-18 13:51:42 +03:00
Vadim Petrochenkov
f0ea1c6f1e
resolve: Improve diagnostics for resolution ambiguities
2018-11-18 13:51:40 +03:00
Oliver Scherer
eb18ddd8f4
Don't auto-inline const fn
2018-11-17 17:50:37 +01:00
giacomo
8e13e433c6
tidy check fix
2018-11-17 12:28:04 +01:00
giacomo
2b7c3fb725
add test for #[test] attribute only allowed on non associated functions
2018-11-17 11:39:58 +01:00
csmoe
d93e5b04f4
reserve whitespaces between prefix and pipe
2018-11-17 17:57:17 +08:00
Axary
5bfdcc1ab1
remove stray file with UI testing output
2018-11-17 09:36:56 +01:00
Ralf Jung
0c0478d57a
adjust remaining tests
2018-11-16 22:04:14 +01:00
Axary
2be930bd03
fix tidy (remove whitespace)
2018-11-16 19:35:13 +01:00
Axary
fe23ffbda0
improve error when self is used as not the first argument
2018-11-16 19:27:27 +01:00
Axary
646d68f585
add a note to the error message
2018-11-16 18:43:06 +01:00
Axary
4c4aff9b3d
remove license
2018-11-16 18:28:23 +01:00
Ralf Jung
303dbccf04
CTFE: dynamically make sure we do not call non-const-fn
2018-11-16 18:05:08 +01:00
Niko Matsakis
6575988d8e
handle trait objects formed from traits with Self::Foo: 'a clauses
2018-11-16 09:37:33 -05:00
Axary
218e35efa1
eat CloseDelim
2018-11-16 13:54:49 +01:00
Axary
80c2101b20
change expected error message
2018-11-16 13:54:09 +01:00
Axary
7cb068e523
add ui test
2018-11-16 13:08:58 +01:00
Oliver Scherer
9b8791179f
Update stderr file
2018-11-16 09:04:35 +01:00
Oliver Scherer
c8a9300d8e
Fix stability hole with static _
2018-11-15 16:16:34 +01:00
csmoe
dbd9abd74d
update closure arg suggesstion ui test
2018-11-15 22:17:49 +08:00
csmoe
052bdff8fb
lint based on closure pipe span
2018-11-15 22:17:03 +08:00
Pietro Albini
d0e08ce88e
Rollup merge of #55956 - euclio:issue-55587, r=estebank
...
add tests for some fixed ICEs
Fixes #55587 .
Fixes #54348 .
Looks like these ICEs are already fixed in nightly, so this PR just adds tests.
r? @estebank
2018-11-15 11:04:47 +01:00
Pietro Albini
3c7acc7878
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
...
Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint
Fixes https://github.com/rust-lang/rust/issues/51043 .
2018-11-15 11:04:40 +01:00
Pietro Albini
6ca7bc0eb8
Rollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-temps-and-their-drops, r=davidtwco
...
More precise spans for temps and their drops
This PR has two main enhancements:
1. when possible during code generation for a statement (like `expr();`), pass along the span of a statement, and then attribute the drops of temporaries from that statement to the statement's end-point (which will be the semicolon if it is a statement that is terminating by a semicolon).
2. when evaluating a block expression into a MIR temp, use the span of the block's tail expression (rather than the span of whole block including its statements and curly-braces) for the span of the temp.
Each of these individually increases the precision of our diagnostic output; together they combine to make a much clearer picture about the control flow through the spans.
Fix #54382
2018-11-15 11:04:37 +01:00
Ralf Jung
b8915f2ba8
fix other affected tests
2018-11-15 10:59:42 +01:00
Ralf Jung
a3770c2547
do not accept out-of-bounds pointers in enum discriminants, they might be NULL
2018-11-15 10:59:39 +01:00
Ralf Jung
ffb6ba0828
validation: better error when the enum discriminant is Undef
2018-11-15 09:58:09 +01:00
Eric Huss
7f4bc2247a
Clean up some non-mod-rs stuff.
2018-11-14 18:55:41 -08:00
Ralf Jung
b396505425
put file and line into miri backtrace
2018-11-14 23:14:57 +01:00
Andy Russell
e2ef0f742c
add test for issue #54348
2018-11-14 12:54:32 -05:00
Andy Russell
055e7b7258
add test for issue #55587
2018-11-14 12:41:39 -05:00
bors
126a0e2aad
Auto merge of #52153 - csmoe:projeq_normal, r=scalexm
...
chalk lowering rule: ProjectionEq-Normalize
cc #49177
r? @scalexm
2018-11-14 02:46:24 +00:00
bors
f1d61837d1
Auto merge of #55912 - kennytm:rollup, r=kennytm
...
Rollup of 20 pull requests
Successful merges:
- #55136 (Remove short doc where it starts with a codeblock)
- #55711 (Format BtreeMap::range_mut example)
- #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters)
- #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err)
- #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to)
- #55805 (Move `static_assert!` into librustc_data_structures)
- #55837 (Make PhantomData #[structural_match])
- #55840 (Fix TLS errors when downloading stage0)
- #55843 (add FromIterator<A> to Box<[A]>)
- #55858 (Small fixes on code blocks in rustdoc)
- #55863 (Fix a typo in std::panic)
- #55870 (Fix typos.)
- #55874 (string: Add documentation for `From` impls)
- #55879 (save-analysis: Don't panic for macro-generated use globs)
- #55882 (Reference count `crate_inherent_impls`s return value.)
- #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra)
- #55889 (global allocators: add a few comments)
- #55896 (Document optimizations enabled by FusedIterator)
- #55905 (Change `Lit::short_name` to `Lit::literal_name`.)
- #55908 (Fix their/there grammar nit)
2018-11-13 22:17:46 +00:00
csmoe
e853d6c5b6
Implement ProjectionEq-Normalize
2018-11-13 20:33:21 +01:00
scalexm
8d0b9697b5
Fix ui tests
2018-11-13 12:28:43 +01:00
scalexm
79b6c41bc2
Use a dummy outlives requirement for where Type:, (see #53696 )
...
A `WF(Type)` predicate was used previously, which did not play
well with implied bounds in chalk.
2018-11-13 12:28:43 +01:00
scalexm
239df7be37
Bypass ppaux for Outlives predicates
2018-11-13 12:28:43 +01:00
scalexm
3510805f7e
Provide program clauses for builtin types
2018-11-13 12:28:43 +01:00
scalexm
eacebf24b0
Pretty print quantified goals and clauses
2018-11-13 12:28:43 +01:00
kennytm
5ccc76fe5c
Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiser
...
Fix typos.
2018-11-13 19:20:44 +08:00
kennytm
f73df10c39
Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, r=eddyb
...
Make PhantomData #[structural_match]
fixes https://github.com/rust-lang/rust/issues/55028
This makes `PhantomData<T>` structurally matchable, irrespective of whether `T` is, per the discussion on this week's language team meeting (the general consensus was that this was a bug-fix).
All types containing `PhantomData<T>` and which used `#[derive(PartialEq, Eq)]` and were previously not `#[structural_match]` only because of `PhantomData<T>` will now be `#[structural_match]`.
r? @nikomatsakis
2018-11-13 19:20:30 +08:00
bors
485397e49a
Auto merge of #55589 - oli-obk:min_length_ 💣 , r=pnkfelix
...
Add `VariantIdx` type and use instead of `usize`
2018-11-13 07:04:14 +00:00
bors
65204a97d4
Auto merge of #55278 - Centril:constification-1, r=alexcrichton
...
Minor standard library constification
This PR makes some bits of the standard library into `const fn`s.
I've tried to be as aggressive as I possibly could in the constification.
The list is rather small due to how restrictive `const fn` is at the moment.
r? @oli-obk cc @rust-lang/libs
Stable public APIs affected:
+ [x] `Cell::as_ptr`
+ [x] `UnsafeCell::get`
+ [x] `char::is_ascii`
+ [x] `iter::empty`
+ [x] `ManuallyDrop::{new, into_inner}`
+ [x] `RangeInclusive::{start, end}`
+ [x] `NonNull::as_ptr`
+ [x] `{[T], str}::as_ptr`
+ [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}`
+ [x] `CStr::as_ptr`
+ [x] `Ipv4Addr::is_unspecified`
+ [x] `Ipv6Addr::new`
+ [x] `Ipv6Addr::octets`
Unstable public APIs affected:
+ [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}`
+ [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}`
+ [x] `core::convert::identity`
--------------------------
## Removed from list in first pass:
Stable public APIs affected:
+ [ ] `BTree{Map, Set}::{len, is_empty}`
+ [ ] `VecDeque::is_empty`
+ [ ] `String::{is_empty, len}`
+ [ ] `FromUtf8Error::utf8_error`
+ [ ] `Vec<T>::{is_empty, len}`
+ [ ] `Layout::size`
+ [ ] `DecodeUtf16Error::unpaired_surrogate`
+ [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}`
+ [ ] `panic::Location::{file, line, column}`
+ [ ] `{ChunksExact, RChunksExact}::remainder`
+ [ ] `Utf8Error::valid_up_to`
+ [ ] `VacantEntry::key`
+ [ ] `NulError::nul_position`
+ [ ] `IntoStringError::utf8_error`
+ [ ] `IntoInnerError::error`
+ [ ] `io::Chain::get_ref`
+ [ ] `io::Take::{limit, get_ref}`
+ [ ] `SocketAddrV6::{flowinfo, scope_id}`
+ [ ] `PrefixComponent::{kind, as_os_str}`
+ [ ] `Path::{ancestors, display}`
+ [ ] `WaitTimeoutResult::timed_out`
+ [ ] `Receiver::{iter, try_iter}`
+ [ ] `thread::JoinHandle::thread`
+ [ ] `SystemTimeError::duration`
Unstable public APIs affected:
+ [ ] `core::fmt::Arguments::new_v1`
+ [ ] `core::fmt::Arguments::new_v1_formatted`
+ [ ] `Pin::{get_ref, into_ref}`
+ [ ] `Utf8Lossy::chunks`
+ [ ] `LocalWaker::as_waker`
+ [ ] `panic::PanicInfo::{internal_constructor, message, location}`
+ [ ] `panic::Location::{internal_constructor }`
## Removed from list in 2nd pass:
Stable public APIs affected:
+ [ ] `LinkedList::{new, iter, is_empty, len}`
+ [ ] `mem::forget`
+ [ ] `Cursor::{new, get_ref, position}`
+ [ ] `io::{empty, repeat, sink}`
+ [ ] `PoisonError::new`
+ [ ] `thread::Builder::new`
+ [ ] `process::Stdio::{piped, inherit, null}`
Unstable public APIs affected:
+ [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12 18:54:11 +00:00
Oliver Scherer
b174b0b955
miri-engine value visitor update to VariantIdx
2018-11-12 14:24:45 +01:00
bors
5a2ca1a6f1
Auto merge of #55657 - davidtwco:issue-55651, r=pnkfelix
...
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field
Fixes #55651 , #55652 .
This PR makes two changes:
First, it updates the dataflow builder to add an init for the place
containing a union if there is an assignment into the field of
that union.
Second, it stops a "use of uninitialized" error occuring when there is an
assignment into the field of an uninitialized union that was previously
initialized. Making this assignment would re-initialize the union, as
tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`.
The check for previous initialization ensures that we do not start
supporting partial initialization yet (cc #21232 , #54499 , #54986 ).
This PR also fixes #55652 which was marked as requiring investigation
as the changes in this PR add an error that was previously missing
(and mentioned in the review comments) and confirms that the error
that was present is correct and a result of earlier partial
initialization changes in NLL.
r? @pnkfelix (due to earlier work with partial initialization)
cc @nikomatsakis
2018-11-11 17:05:36 +00:00
Bruce Mitchener
a62af858e0
Fix typos.
2018-11-11 20:52:36 +07:00