]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #52521 - ehuss:rustdoc-passes-doc, r=kennytm
kennytm [Sun, 22 Jul 2018 14:10:14 +0000 (22:10 +0800)]
Rollup merge of #52521 - ehuss:rustdoc-passes-doc, r=kennytm

Fix links in rustdoc book.

Due to a change in how mdbook generates section anchors, headers
with non-alphabetic characters now start with "a".

6 years agoRollup merge of #52508 - joshtriplett:dangling-not-sentinel, r=Mark-Simulacrum
kennytm [Sun, 22 Jul 2018 14:10:13 +0000 (22:10 +0800)]
Rollup merge of #52508 - joshtriplett:dangling-not-sentinel, r=Mark-Simulacrum

Document that Unique::empty() and NonNull::dangling() aren't sentinel values

The documentation of Unique::empty() and NonNull::dangling() could
potentially suggest that they work as sentinel values indicating a
not-yet-initialized pointer. However, they both declare a non-null
pointer equal to the alignment of the type, which could potentially
reference a valid value of that type (specifically, the first such valid
value in memory). Explicitly document that the return value of these
functions does not work as a sentinel value.

6 years agoRollup merge of #52507 - estebank:infer-type, r=nikomatsakis
kennytm [Sun, 22 Jul 2018 14:10:11 +0000 (22:10 +0800)]
Rollup merge of #52507 - estebank:infer-type, r=nikomatsakis

Reword when `_` couldn't be inferred

r? @nikomatsakis

6 years agoRollup merge of #52465 - sekineh:add-ci-thumb, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:10 +0000 (22:10 +0800)]
Rollup merge of #52465 - sekineh:add-ci-thumb, r=alexcrichton

Add CI test harness for `thumb*` targets. [IRR-2018-embedded]

This pull request will do the following (rather trivial) changes:
- Fix #52163. In other words, we enabled `./x.py test src/test/run-make` for `no_std` targets.
- Modify `dist-various-1` Dockerfile.
  - CI now performs `run-make` test run on the targets below:
    - `thumbv6m-none-eabi`
    - `thumbv7m-none-eabi`
    - `thumbv7em-none-eabi`
    - `thumbv7em-none-eabihf`.
- ~~Add `thumb-none` Dockerfile.~~
  - ~~Initially, `thumbv7m-none-eabi`, `thumbv7em-none-eabi` and `thumbv7em-none-eabihf` are included as the tested target. `thumbv6m-none-eabi` is disabled for now because LLVM support is not certain.~~
- ~~Add `thumb-none` to .travis.yml~~

Note:
- `run-make` tests are not implemented yet. This PR is test harness only.

The amount of change is very small, but I'd like to open the pull request while the change is trivial.
Because I'm not very used to pull request process, I want to make a small progress first.  This PR will be a foundation for later additions.

CC @kennytm @jamesmunns @nerdyvaishali

6 years agoRollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichton
kennytm [Sun, 22 Jul 2018 14:10:09 +0000 (22:10 +0800)]
Rollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichton

Deprecation of str::slice_unchecked(_mut)

Closes #51715

I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0.

Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.

6 years agoAuto merge of #52368 - GuillaumeGomez:intra_doc_link_resolution_failure-documented...
bors [Sun, 22 Jul 2018 10:48:15 +0000 (10:48 +0000)]
Auto merge of #52368 - GuillaumeGomez:intra_doc_link_resolution_failure-documented, r=QuietMisdreavus

Add "self" intra-link support

Fixes #49583.

r? @QuietMisdreavus

6 years agoAuto merge of #52359 - matthewjasper:combine-move-error-reporting, r=pnkfelix
bors [Sun, 22 Jul 2018 08:52:05 +0000 (08:52 +0000)]
Auto merge of #52359 - matthewjasper:combine-move-error-reporting, r=pnkfelix

[NLL] Small move error reporting improvements

* Use a MirBorrowckContext when reporting errors to be more uniform with other error reporting
* Add a special message for the case of trying to move from capture variables in `Fn` and `FnMut` closures.

part of #51028

6 years agoAuto merge of #52394 - estebank:println, r=oli-obk
bors [Sun, 22 Jul 2018 06:52:48 +0000 (06:52 +0000)]
Auto merge of #52394 - estebank:println, r=oli-obk

Improve suggestion for missing fmt str in println

Avoid using `concat!(fmt, "\n")` to improve the diagnostics being
emitted when the first `println!()` argument isn't a formatting string
literal.

Fix #52347.

6 years agofix test
Esteban Küber [Sun, 22 Jul 2018 03:48:15 +0000 (20:48 -0700)]
fix test

6 years agoAuto merge of #52250 - nnethercote:no-SparseBitMatrix, r=nikomatsakis
bors [Sun, 22 Jul 2018 02:43:57 +0000 (02:43 +0000)]
Auto merge of #52250 - nnethercote:no-SparseBitMatrix, r=nikomatsakis

Speed up `SparseBitMatrix` use in `RegionValues`.

In practice, these matrices range from 10% to 90%+ full once they are
filled in, so the dense representation is better.

This reduces the runtime of Check Nll builds of `inflate` by 32%, and
several other benchmarks by 1--5%.

It also increases max-rss of `clap-rs` by 30% and a couple of others by
up to 5%, while decreasing max-rss of `coercions` by 14%. I think the
speed-ups justify the max-rss increases.

r? @nikomatsakis

6 years agofix tidy ~ again
Esteban Küber [Sun, 22 Jul 2018 01:24:10 +0000 (18:24 -0700)]
fix tidy ~ again

6 years agoDon't use the new `eprintln` for stage0 and stage1
Esteban Küber [Sun, 22 Jul 2018 00:59:17 +0000 (17:59 -0700)]
Don't use the new `eprintln` for stage0 and stage1

I'm not entirely sure why (or if) this is needed.

6 years agoFix tidy by adding new feature gate test
Esteban Küber [Sun, 22 Jul 2018 00:35:09 +0000 (17:35 -0700)]
Fix tidy by adding new feature gate test

6 years agofix logic bug
Esteban Küber [Sun, 22 Jul 2018 00:17:49 +0000 (17:17 -0700)]
fix logic bug

6 years agoAuto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomez
bors [Sat, 21 Jul 2018 23:50:28 +0000 (23:50 +0000)]
Auto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomez

Remove highlighting from secondary messages

Deemphasize the secondary messages so that all other highlights stand
out more.

<img width="684" alt="" src="https://user-images.githubusercontent.com/1606434/41261199-7b4fe96e-6d8f-11e8-8619-04d170617df2.png">

6 years agoRemove dependency on `libsyntax`
Esteban Küber [Sat, 21 Jul 2018 23:18:06 +0000 (16:18 -0700)]
Remove dependency on `libsyntax`

6 years agoChange `eprintln!()`
Esteban Küber [Sat, 21 Jul 2018 22:56:37 +0000 (15:56 -0700)]
Change `eprintln!()`

Address #30143 as well. `writeln!()` hasn't been changed.

6 years agoGate `format_args_nll` behind feature flag
Esteban Küber [Sat, 21 Jul 2018 22:50:46 +0000 (15:50 -0700)]
Gate `format_args_nll` behind feature flag

6 years agoAdd "self" intra-link support
Guillaume Gomez [Thu, 12 Jul 2018 20:00:57 +0000 (22:00 +0200)]
Add "self" intra-link support

6 years agoAuto merge of #52115 - Dylan-DPC:feature/nll-liveness-regions, r=nikomatsakis
bors [Sat, 21 Jul 2018 21:01:17 +0000 (21:01 +0000)]
Auto merge of #52115 - Dylan-DPC:feature/nll-liveness-regions, r=nikomatsakis

only compute liveness for variables whose types include regions

Closes #52034

r? @nikomatsakis

6 years agoSuggest space separated format str literal
Esteban Küber [Sat, 21 Jul 2018 19:16:06 +0000 (12:16 -0700)]
Suggest space separated format str literal

6 years agoAuto merge of #51959 - tmandry:make-implied-outlives-query, r=nikomatsakis
bors [Sat, 21 Jul 2018 18:51:13 +0000 (18:51 +0000)]
Auto merge of #51959 - tmandry:make-implied-outlives-query, r=nikomatsakis

Turn implied_outlives_bounds into a query

Right now all this does is remove the error reporting in `implied_outlives_bounds`, which seems to work. Farming out full tests to Travis.

For #51649. That issue is deferred so not sure what's next.

r? @nikomatsakis

6 years agoupdate tests
Matthew Jasper [Thu, 19 Jul 2018 20:15:10 +0000 (21:15 +0100)]
update tests

6 years agoFix #52416 - ice for move errors in unsafe blocks
Matthew Jasper [Wed, 18 Jul 2018 20:03:07 +0000 (21:03 +0100)]
Fix #52416 - ice for move errors in unsafe blocks

6 years agoAdd specific message when moving from upvars in a non-FnOnce closure
Matthew Jasper [Fri, 13 Jul 2018 22:39:10 +0000 (23:39 +0100)]
Add specific message when moving from upvars  in a non-FnOnce closure

6 years agoUse MirBorrowckCtxt while reporting move errors
Matthew Jasper [Fri, 13 Jul 2018 20:56:04 +0000 (21:56 +0100)]
Use MirBorrowckCtxt while reporting move errors

6 years agoAuto merge of #52405 - matthewjasper:mutability-errors, r=pnkfelix
bors [Sat, 21 Jul 2018 14:37:45 +0000 (14:37 +0000)]
Auto merge of #52405 - matthewjasper:mutability-errors, r=pnkfelix

[NLL] Mutability errors

cc #51028
cc #51170
cc #46559
Closes #46629

* Better explain why the place is immutable ("immutable item" is gone)
* Distinguish &T and *const T
* Use better spans when a mutable borrow is for a closure capture

r? @pnkfelix

6 years agodelete tests
dylan_DPC [Sat, 21 Jul 2018 14:16:41 +0000 (19:46 +0530)]
delete tests

6 years agoTreat no_std(target) == None case correctly.
Hideki Sekine [Sat, 21 Jul 2018 13:39:35 +0000 (22:39 +0900)]
Treat no_std(target) == None case correctly.

6 years agowe now get 2 extra mismatched type errors
Niko Matsakis [Thu, 19 Jul 2018 04:10:35 +0000 (00:10 -0400)]
we now get 2 extra mismatched type errors

These new errors actually seem a *tad* clearer than the old one, so
that's good, but now there are 3. Maybe call it a wash?

6 years agouse proper body-id and span when solving obligations
Niko Matsakis [Wed, 18 Jul 2018 19:24:00 +0000 (15:24 -0400)]
use proper body-id and span when solving obligations

6 years agoadd regression test for #52078
Niko Matsakis [Wed, 18 Jul 2018 18:59:36 +0000 (14:59 -0400)]
add regression test for #52078

Fixes #52078

6 years agoskip no-op obligations and add a little debug output
Niko Matsakis [Wed, 18 Jul 2018 15:05:07 +0000 (11:05 -0400)]
skip no-op obligations and add a little debug output

6 years agoConvert implied_outlives_bounds to a query
Tyler Mandry [Wed, 4 Jul 2018 18:07:45 +0000 (13:07 -0500)]
Convert implied_outlives_bounds to a query

6 years agoAuto merge of #52562 - Manishearth:clippyup, r=RalfJung
bors [Sat, 21 Jul 2018 12:32:17 +0000 (12:32 +0000)]
Auto merge of #52562 - Manishearth:clippyup, r=RalfJung

Update clippy

r? @kennytm @oli-obk

6 years agoadd docs
dylan_DPC [Sat, 21 Jul 2018 11:51:04 +0000 (17:21 +0530)]
add docs

6 years agoDon't invent new magic keywords
Oliver Schneider [Sat, 21 Jul 2018 10:36:18 +0000 (12:36 +0200)]
Don't invent new magic keywords

6 years agoAuto merge of #52555 - petrochenkov:mresfact, r=alexcrichton
bors [Sat, 21 Jul 2018 10:30:11 +0000 (10:30 +0000)]
Auto merge of #52555 - petrochenkov:mresfact, r=alexcrichton

resolve: Some renaming, refactoring and comments

Commits are self-descriptive.
The only functional change is https://github.com/rust-lang/rust/commit/34bf2f572e33d4df1459413b5014ca98fc9fa4e0 that tightens shadowing rules for macro paths (makes the second and third cases in `test/ui/imports/glob-shadowing.rs` an error).

6 years agoAuto merge of #52552 - eddyb:proc-macro-prep, r=alexcrichton
bors [Sat, 21 Jul 2018 08:31:32 +0000 (08:31 +0000)]
Auto merge of #52552 - eddyb:proc-macro-prep, r=alexcrichton

Prepare proc_macro for decoupling it from the rest of the compiler.

This is #49219 up to the point where the bridge is introduced. Aside from moving some code around, the largest change is the rewrite of `proc_macro::quote` to be simpler and do less introspection.

I'd like to also extend `quote!` with `${stmt;...;expr}` instead of just `$variable` (and maybe even `$(... $iter ...)*`), which seems pretty straight-forward now, but I don't know if/when I should.

r? @alexcrichton or @dtolnay cc @jseyfried @petrochenkov

6 years agoAuto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum
bors [Sat, 21 Jul 2018 06:26:18 +0000 (06:26 +0000)]
Auto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum

Update stdsimd to undo an accidental stabilization

Closes #52403

6 years agoremove unwanted tests and a reference to it in comments
dylan_DPC [Sat, 21 Jul 2018 06:12:44 +0000 (11:42 +0530)]
remove unwanted tests and a reference to it in comments

6 years agoUpdate stdsimd to undo an accidental stabilization
Alex Crichton [Thu, 19 Jul 2018 14:01:37 +0000 (07:01 -0700)]
Update stdsimd to undo an accidental stabilization

Closes #52403

6 years agoAuto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis
bors [Sat, 21 Jul 2018 04:19:15 +0000 (04:19 +0000)]
Auto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis

proc_macro: Preserve spans of attributes on functions

This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.

Closes #47941

6 years agoAuto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb
bors [Sat, 21 Jul 2018 00:55:46 +0000 (00:55 +0000)]
Auto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb

Calculate Vec capacities in librustc

Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.

6 years agoAuto merge of #52574 - kennytm:rollup, r=kennytm
bors [Fri, 20 Jul 2018 22:52:11 +0000 (22:52 +0000)]
Auto merge of #52574 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #52502 (fix unsafety: don't call ptr_rotate for ZST)
 - #52505 (rustc: Remove a workaround in ThinLTO fixed upstream)
 - #52526 (Enable run-pass/sepcomp-lib-lto.rs on Android)
 - #52527 (Remove duplicate E0396 tests)
 - #52539 (rustc: Fix two custom attributes with custom derive)
 - #52540 (Fix docker/run.sh script when run locally)
 - #52573 (Cleanups)

Failed merges:

r? @ghost

6 years agofix grep test looking for newline
Esteban Küber [Fri, 20 Jul 2018 20:43:06 +0000 (13:43 -0700)]
fix grep test looking for newline

6 years agoClippy opts out of in_external_macro
Oliver Schneider [Fri, 20 Jul 2018 20:50:32 +0000 (22:50 +0200)]
Clippy opts out of in_external_macro

6 years agoAllow individual lints to opt into being reported in external macros
Oliver Schneider [Fri, 20 Jul 2018 20:45:52 +0000 (22:45 +0200)]
Allow individual lints to opt into being reported in external macros

6 years agoRollup merge of #52573 - oli-obk:cleanups, r=RalfJung
kennytm [Fri, 20 Jul 2018 18:59:13 +0000 (02:59 +0800)]
Rollup merge of #52573 - oli-obk:cleanups, r=RalfJung

Cleanups

r? @RalfJung

6 years agoRollup merge of #52540 - alexcrichton:tweak-script, r=kennytm
kennytm [Fri, 20 Jul 2018 18:59:10 +0000 (02:59 +0800)]
Rollup merge of #52540 - alexcrichton:tweak-script, r=kennytm

Fix docker/run.sh script when run locally

Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.

6 years agoRollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov
kennytm [Fri, 20 Jul 2018 18:59:09 +0000 (02:59 +0800)]
Rollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov

rustc: Fix two custom attributes with custom derive

This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.

The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.

Closes #52525

6 years agoRollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk
kennytm [Fri, 20 Jul 2018 18:59:08 +0000 (02:59 +0800)]
Rollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk

Remove duplicate E0396 tests

Resolves FIXME #13973 (erroneously marked as #13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.

6 years agoRollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton
kennytm [Fri, 20 Jul 2018 18:59:06 +0000 (02:59 +0800)]
Rollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton

Enable run-pass/sepcomp-lib-lto.rs on Android

#18800 is fixed, so it should be safe to restore this test.

6 years agoRollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis
kennytm [Fri, 20 Jul 2018 18:59:05 +0000 (02:59 +0800)]
Rollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis

rustc: Remove a workaround in ThinLTO fixed upstream

This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!

[1]: https://bugs.llvm.org/show_bug.cgi?id=35736

6 years agoRollup merge of #52502 - RalfJung:rotate, r=scottmcm
kennytm [Fri, 20 Jul 2018 18:59:04 +0000 (02:59 +0800)]
Rollup merge of #52502 - RalfJung:rotate, r=scottmcm

fix unsafety: don't call ptr_rotate for ZST

`rotate::ptr_rotate` has a comment saying
```
/// # Safety
///
/// The specified range must be valid for reading and writing.
/// The type `T` must have non-zero size.
```
So we better make sure we don't call it on ZST...

Cc @scottmcm (author of https://github.com/rust-lang/rust/pull/41670)

6 years agoRefactor a few push loops to iterators in librustc
ljedrz [Mon, 16 Jul 2018 17:35:45 +0000 (19:35 +0200)]
Refactor a few push loops to iterators in librustc

6 years agoUpdate tests for new NLL mutability errors
Matthew Jasper [Tue, 17 Jul 2018 19:29:48 +0000 (20:29 +0100)]
Update tests for new NLL mutability errors

6 years agoImprove NLL mutability errors
Matthew Jasper [Sun, 15 Jul 2018 14:51:35 +0000 (15:51 +0100)]
Improve NLL mutability errors

* Better explain why the place is immutable
* Distinguish &T and *const T
* Use better spans when a mutable borrow is for a closure capture

6 years agoMove mutability error reporting to its own file
Matthew Jasper [Sun, 15 Jul 2018 14:11:29 +0000 (15:11 +0100)]
Move mutability error reporting to its own file

6 years agoMIR changes to improve NLL cannot mutate errors
Matthew Jasper [Sun, 15 Jul 2018 14:00:58 +0000 (15:00 +0100)]
MIR changes to improve NLL cannot mutate errors

Alway use unique instead of mutable borrows immutable upvars.
Mark variables that are references for a match guard

6 years agoUpdate clippy
Manish Goregaokar [Fri, 20 Jul 2018 07:53:56 +0000 (00:53 -0700)]
Update clippy

6 years agofix rebase
Esteban Küber [Fri, 20 Jul 2018 18:04:23 +0000 (11:04 -0700)]
fix rebase

6 years agoAuto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez
bors [Fri, 20 Jul 2018 18:02:05 +0000 (18:02 +0000)]
Auto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez

stabilize lint handling in rustdoc

When https://github.com/rust-lang/rust/pull/51732 added CLI flags to manipulate lints in rustdoc, they were added as unstable flags. This made sense as they were new additions, but since they mirrored the flags that rustc has, it's worth considering them to not need an unstable period.

Stabilizing them also provides the opportunity for a critical fix: allowing Cargo to pass `--cap-lints allow` when documenting dependencies, the same as when it compiles them.

r? @rust-lang/rustdoc

6 years agoRemove unused method
Oliver Schneider [Fri, 20 Jul 2018 16:42:45 +0000 (18:42 +0200)]
Remove unused method

6 years agoFix new test
Esteban Küber [Fri, 20 Jul 2018 16:17:55 +0000 (09:17 -0700)]
Fix new test

6 years agoReword when `_` couldn't be inferred
Esteban Küber [Wed, 18 Jul 2018 19:35:20 +0000 (12:35 -0700)]
Reword when `_` couldn't be inferred

6 years agofix incorrect position of chars in fmt str
Esteban Küber [Fri, 20 Jul 2018 16:15:22 +0000 (09:15 -0700)]
fix incorrect position of chars in fmt str

6 years agoOnly methods are fn-like, not other associated items
Oliver Schneider [Fri, 20 Jul 2018 15:19:58 +0000 (17:19 +0200)]
Only methods are fn-like, not other associated items

6 years agoAuto merge of #52498 - oli-obk:const_prop, r=nikomatsakis
bors [Fri, 20 Jul 2018 13:22:36 +0000 (13:22 +0000)]
Auto merge of #52498 - oli-obk:const_prop, r=nikomatsakis

Const propagate casts

fixes #49760

So... This fixes the original issue about the missing warnings.

But our test suite contains fun things like

```rust
fn foo() {}
assert_eq!(foo as i16, foo as usize as i16);
```

Which, will result in

> a raw memory access tried to access part of a pointer value as raw bytes

on both sides of the assertion. Because well... that's exactly what's going on! We're ripping out 16 bits of a pointer.

6 years agotidy up
dylan_DPC [Fri, 20 Jul 2018 13:10:52 +0000 (18:40 +0530)]
tidy up

6 years agomove NllLivenessMap and LocalWithRegion to liveness_map
dylan_DPC [Fri, 20 Jul 2018 12:00:03 +0000 (17:30 +0530)]
move NllLivenessMap and LocalWithRegion to liveness_map

6 years agoAuto merge of #52476 - wesleywiser:categorize_queries, r=nikomatsakis
bors [Fri, 20 Jul 2018 11:10:58 +0000 (11:10 +0000)]
Auto merge of #52476 - wesleywiser:categorize_queries, r=nikomatsakis

Categorize queries for later self-profiling

Change the define_queries! macro per feedback on #51657.

Big thanks to @mark-i-m for the help getting the macro changes correct!

I'm pulling this commit out of the other PR because it's hard to keep up-to-date as queries are added or changed.

r? @nikomatsakis

6 years agoRevert some use of `PtrKey` to fix parallel_queries build
Vadim Petrochenkov [Fri, 20 Jul 2018 09:45:07 +0000 (12:45 +0300)]
Revert some use of `PtrKey` to fix parallel_queries build

6 years agoresolve: Add more comments to in-module resolution
Vadim Petrochenkov [Thu, 19 Jul 2018 22:45:08 +0000 (01:45 +0300)]
resolve: Add more comments to in-module resolution

6 years agoresolve: Fully prohibit shadowing of in-scope names by globs in macro paths
Vadim Petrochenkov [Thu, 19 Jul 2018 22:11:30 +0000 (01:11 +0300)]
resolve: Fully prohibit shadowing of in-scope names by globs in macro paths

6 years agodata_structures: Add a reference wrapper for pointer-indexed maps/sets
Vadim Petrochenkov [Wed, 18 Jul 2018 18:53:54 +0000 (21:53 +0300)]
data_structures: Add a reference wrapper for pointer-indexed maps/sets

Use `ptr::eq` for comparing pointers

6 years agoresolve: Add some comments to in-module resolution
Vadim Petrochenkov [Wed, 18 Jul 2018 00:08:49 +0000 (03:08 +0300)]
resolve: Add some comments to in-module resolution

6 years agoresolve: Remove `SingleImports` in favor of a simple set
Vadim Petrochenkov [Tue, 17 Jul 2018 01:12:48 +0000 (04:12 +0300)]
resolve: Remove `SingleImports` in favor of a simple set

6 years agoresolve: Rename `global_macros` to `macro_prelude`
Vadim Petrochenkov [Mon, 16 Jul 2018 18:36:13 +0000 (21:36 +0300)]
resolve: Rename `global_macros` to `macro_prelude`

Rename `shadows_glob` to `shadowed_glob`

6 years agoresolve: Remove unused parameter from `resolve_ident_in_module`
Vadim Petrochenkov [Mon, 16 Jul 2018 18:25:52 +0000 (21:25 +0300)]
resolve: Remove unused parameter from `resolve_ident_in_module`

6 years agoAuto merge of #52467 - alexcrichton:lints-and-macros, r=Manishearth
bors [Fri, 20 Jul 2018 08:54:14 +0000 (08:54 +0000)]
Auto merge of #52467 - alexcrichton:lints-and-macros, r=Manishearth

Squash all lints tied to foreign macros by default

This PR is a continuation of https://github.com/rust-lang/rust/pull/49755 (thanks for the initial jump-start @Dylan-DPC!) and is targeted at solving https://github.com/rust-lang/rust/issues/48855. This change updates the lint infrastructure to, by default, ignore all lints emitted for code that originates in a foreign macro. For example if `println!("...")` injects some idiomatic warnings these are all ignored by default. The rationale here is that for almost all lints there's no action that can be taken if the code originates from a foreign lint.

Closes #48855
Closes #52483
Closes #52479

6 years agoRemove duplicate E0396 tests
ljedrz [Thu, 19 Jul 2018 08:28:25 +0000 (10:28 +0200)]
Remove duplicate E0396 tests

6 years agoAuto merge of #52445 - alexcrichton:wasm-import-module, r=eddyb
bors [Fri, 20 Jul 2018 06:40:10 +0000 (06:40 +0000)]
Auto merge of #52445 - alexcrichton:wasm-import-module, r=eddyb

rustc: Stabilize #[wasm_import_module] as #[link(...)]

This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.

Closes #52090

6 years agoRebase and fix text changed by master
Esteban Küber [Fri, 20 Jul 2018 06:19:13 +0000 (23:19 -0700)]
Rebase and fix text changed by master

6 years agoUse correct spans for format string errors
Esteban Küber [Fri, 20 Jul 2018 06:14:00 +0000 (23:14 -0700)]
Use correct spans for format string errors

When encountering format string errors in a raw string, or regular
string literal with embedded newlines, account for the positional
change to use correct spans.

:drive by fix: 🚗

6 years agorework println
Esteban Küber [Fri, 20 Jul 2018 01:53:26 +0000 (18:53 -0700)]
rework println

6 years agoFix hir tree test
Esteban Küber [Sun, 15 Jul 2018 21:36:19 +0000 (14:36 -0700)]
Fix hir tree test

6 years agoSame change as `println` for `eprintln`
Esteban Küber [Sun, 15 Jul 2018 19:28:42 +0000 (12:28 -0700)]
Same change as `println` for `eprintln`

6 years agoreview comments: modify note wording and change `println`
Esteban Küber [Sun, 15 Jul 2018 18:52:11 +0000 (11:52 -0700)]
review comments: modify note wording and change `println`

- Don't print the newline on its own to avoid the possibility of
  printing it out of order due to `stdout` locking.
- Modify wording of `concat!()` with non-literals to not mislead into
  believing that only `&str` literals are accepted.
- Add test for `concat!()` with non-literals.

6 years agoImprove suggestion for missing fmt str in println
Esteban Küber [Sun, 15 Jul 2018 03:50:30 +0000 (20:50 -0700)]
Improve suggestion for missing fmt str in println

Avoid using `concat!(fmt, "\n")` to improve the diagnostics being
emitted when the first `println!()` argument isn't a formatting string
literal.

6 years agoSpeed up `SparseBitMatrix`.
Nicholas Nethercote [Wed, 18 Jul 2018 05:03:43 +0000 (15:03 +1000)]
Speed up `SparseBitMatrix`.

Using a `BTreeMap` to represent rows in the bit matrix is really slow.
This patch changes things so that each row is represented by a
`BitVector`. This is a less sparse representation, but a much faster
one.

As a result, `SparseBitSet` and `SparseChunk` can be removed.

Other minor changes in this patch.

- It renames `BitVector::insert()` as `merge()`, which matches the
  terminology in the other classes in bitvec.rs.

- It removes `SparseBitMatrix::is_subset()`, which is unused.

- It reinstates `RegionValueElements::num_elements()`, which #52190 had
  removed.

- It removes a low-value `debug!` call in `SparseBitMatrix::add()`.

6 years agoalways get number of live variables from the map
Niko Matsakis [Fri, 20 Jul 2018 04:46:06 +0000 (00:46 -0400)]
always get number of live variables from the map

6 years agoproc_macro: avoid exposing internal details in formatting impls.
Eduard-Mihai Burtescu [Thu, 19 Jul 2018 21:09:05 +0000 (00:09 +0300)]
proc_macro: avoid exposing internal details in formatting impls.

6 years agoproc_macro: move some implementation details to a rustc module.
Eduard-Mihai Burtescu [Thu, 19 Jul 2018 12:59:08 +0000 (15:59 +0300)]
proc_macro: move some implementation details to a rustc module.

6 years agoAuto merge of #52349 - RalfJung:once, r=alexcrichton
bors [Fri, 20 Jul 2018 02:52:19 +0000 (02:52 +0000)]
Auto merge of #52349 - RalfJung:once, r=alexcrichton

sync::Once use release-acquire access modes

Nothing here makes a case distinction like "this happened before OR after that". All we need is to get happens-before edges whenever we see that the state/signal has been changed. Release-acquire is good enough for that.

6 years agoproc_macro: don't expose compiler-internal FileName in public API.
Eduard-Mihai Burtescu [Fri, 16 Mar 2018 15:04:14 +0000 (17:04 +0200)]
proc_macro: don't expose compiler-internal FileName in public API.

6 years agoproc_macro: clean up the implementation of quasi-quoting.
Eduard-Mihai Burtescu [Sun, 22 Apr 2018 00:05:02 +0000 (03:05 +0300)]
proc_macro: clean up the implementation of quasi-quoting.

6 years agoproc_macro: don't try to reflect literals in quasi-quoting.
Eduard-Mihai Burtescu [Sat, 21 Apr 2018 19:16:55 +0000 (22:16 +0300)]
proc_macro: don't try to reflect literals in quasi-quoting.

6 years agoproc_macro: don't use DiagnosticBuilder for building up Diagnostics.
Eduard-Mihai Burtescu [Sat, 21 Apr 2018 18:33:20 +0000 (21:33 +0300)]
proc_macro: don't use DiagnosticBuilder for building up Diagnostics.

6 years agoAuto merge of #52024 - oli-obk:existential_parse, r=nikomatsakis
bors [Thu, 19 Jul 2018 21:14:01 +0000 (21:14 +0000)]
Auto merge of #52024 - oli-obk:existential_parse, r=nikomatsakis

Implement existential types

(not for associated types yet)

r? @nikomatsakis

cc @Centril @varkor @alexreg