Commit Graph

81168 Commits

Author SHA1 Message Date
ljedrz
e3d14c4c56 Refactor a few push loops to iterators in librustc 2018-07-20 21:57:12 +02:00
Matthew Jasper
a06b2433fc Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
Matthew Jasper
13b5f69848 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
2018-07-20 20:01:11 +01:00
Matthew Jasper
db568e426a Move mutability error reporting to its own file 2018-07-20 20:01:11 +01:00
Matthew Jasper
c3dbdfee06 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
2018-07-20 20:01:11 +01:00
Manish Goregaokar
d63e9257b9 Update clippy 2018-07-20 20:58:06 +02:00
QuietMisdreavus
e3bc713e2e compiletest: don't overwrite failure-status if it was previously set 2018-07-20 13:25:44 -05:00
Esteban Küber
9112e1a4cd fix rebase 2018-07-20 11:04:23 -07:00
bors
878dd0b5e1 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
2018-07-20 18:02:05 +00:00
Oliver Schneider
297ad72f12
Add trailing newline 2018-07-20 19:55:16 +02:00
Oliver Schneider
92fad0fa9e Add test 2018-07-20 19:35:08 +02:00
Oliver Schneider
7064f69c43 Abort instead of UB if promotion fails 2018-07-20 19:00:48 +02:00
Oliver Schneider
c7d39e0c51 Remove unused method 2018-07-20 18:43:25 +02:00
Esteban Küber
70e7e7d409 Fix new test 2018-07-20 09:17:55 -07:00
Esteban Küber
e1ef8ba142 Reword when _ couldn't be inferred 2018-07-20 09:17:18 -07:00
Esteban Küber
052159be53 fix incorrect position of chars in fmt str 2018-07-20 09:15:22 -07:00
Oliver Schneider
7cab813ad9 Only methods are fn-like, not other associated items 2018-07-20 17:19:58 +02:00
QuietMisdreavus
d3569d2da8 add failure-status to rustdoc doctest ui test 2018-07-20 10:13:38 -05:00
QuietMisdreavus
d965371d86 normalize test output so it can be run from repo root 2018-07-20 10:13:38 -05:00
QuietMisdreavus
ffbd2b931e update stdout file with test path normalization 2018-07-20 10:13:38 -05:00
QuietMisdreavus
41e7ac16c4 report doctest compile failures correctly 2018-07-20 10:13:38 -05:00
QuietMisdreavus
33654195a1 add ui test for failing doctest 2018-07-20 10:13:38 -05:00
QuietMisdreavus
d17a378b16 rustdoc: set panic output before starting compiler thread pool 2018-07-20 10:13:37 -05:00
Oliver Schneider
e93635325b Properly scope label resolution 2018-07-20 16:18:22 +02:00
Oliver Schneider
3e832b83fe Remove outdated comment 2018-07-20 15:59:21 +02:00
Oliver Schneider
56c90774a9 Make sure the compiler actually panics on delay_span_bug
Even if that is just happening because of `abort_if_errors`
2018-07-20 15:59:21 +02:00
bors
509cbf3e8e 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.
2018-07-20 13:22:36 +00:00
dylan_DPC
dbb756ded7 tidy up 2018-07-20 18:40:52 +05:30
Felix S. Klock II
f153be6258 For some reason, on my linux box, using -Zverbose here is causing a linker failure.
Rather than try to work out what was happening, I just removed the flag because
I see no reason for it to be on this test.
2018-07-20 14:26:44 +02:00
Felix S. Klock II
1185798680 Regression test for issue. 2018-07-20 14:26:40 +02:00
dylan_DPC
4e3339efda move NllLivenessMap and LocalWithRegion to liveness_map 2018-07-20 17:51:34 +05:30
Felix S. Klock II
c83602a702 When type-checking binops, LHS of assign-op like += is invariant.
Therefore we cannot coerce it to a supertype the same way that we can
the LHS of `+`.

Addresses issue 52126.
2018-07-20 13:12:30 +02:00
bors
3bea4d1fc6 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
2018-07-20 11:10:58 +00:00
Vadim Petrochenkov
382285a01d Revert some use of PtrKey to fix parallel_queries build 2018-07-20 12:45:07 +03:00
Vadim Petrochenkov
e7aeb2b1c7 resolve: Add more comments to in-module resolution 2018-07-20 12:22:25 +03:00
Vadim Petrochenkov
32453db332 resolve: Fully prohibit shadowing of in-scope names by globs in macro paths 2018-07-20 12:22:24 +03:00
Vadim Petrochenkov
2eb83ee527 data_structures: Add a reference wrapper for pointer-indexed maps/sets
Use `ptr::eq` for comparing pointers
2018-07-20 12:22:24 +03:00
Vadim Petrochenkov
414a86e759 resolve: Add some comments to in-module resolution 2018-07-20 12:22:24 +03:00
Vadim Petrochenkov
c2533b64a3 resolve: Remove SingleImports in favor of a simple set 2018-07-20 12:22:24 +03:00
Vadim Petrochenkov
22143491bc resolve: Rename global_macros to macro_prelude
Rename `shadows_glob` to `shadowed_glob`
2018-07-20 12:22:24 +03:00
Vadim Petrochenkov
c44f72430c resolve: Remove unused parameter from resolve_ident_in_module 2018-07-20 12:22:24 +03:00
bors
4260c8b1e4 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
2018-07-20 08:54:14 +00:00
ljedrz
576cfc510a Remove duplicate E0396 tests 2018-07-20 09:47:55 +02:00
bors
a5097f3d68 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
2018-07-20 06:40:10 +00:00
ljedrz
35a3d6f76b Remove obsolete armv5te vars from the dist-various-1 Dockerfile 2018-07-20 08:34:34 +02:00
Esteban Küber
85da68cb6d Rebase and fix text changed by master 2018-07-19 23:21:00 -07:00
Esteban Küber
f4306ffbfc 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: 🚗
2018-07-19 23:18:07 -07:00
Esteban Küber
154dee2dcc rework println 2018-07-19 23:18:07 -07:00
Esteban Küber
a47653214f Fix hir tree test 2018-07-19 23:18:07 -07:00
Esteban Küber
e613bfb701 Same change as println for eprintln 2018-07-19 23:18:07 -07:00