Commit Graph

122829 Commits

Author SHA1 Message Date
Ralf Jung
8200771aa2 reveal_all when sanity-checking MIR assignment types 2020-06-22 09:19:08 +02:00
Ralf Jung
9576e307a7 also normalize_erasing_regions 2020-06-22 09:19:08 +02:00
Ralf Jung
93e3552d04 also normalize constants when comparing types 2020-06-22 09:19:08 +02:00
Ralf Jung
50d7deac4d prepare visit_statement for checking more kinds of statements 2020-06-22 09:19:08 +02:00
Ralf Jung
810f309ff3 MIR sanity check: validate types on assignment 2020-06-22 09:19:08 +02:00
Rich Kadel
933fe80577 num_counters to u32, after implementing TypeFoldable 2020-06-21 23:48:39 -07:00
Aaron Hill
953104e60c
Fix spurious 'value moved here in previous iteration of loop' messages
Fixes #46099

Previously, we would check the 'move' and 'use' spans to see if we
should emit this message. However, this can give false positives when
macros are involved, since two distinct expressions may end up with the
same span.

Instead, we check the actual MIR `Location`, which eliminates false
positives.
2020-06-21 21:27:34 -04:00
Amanieu d'Antras
a98868dc9f Update asm! documentation 2020-06-22 00:22:23 +01:00
marmeladema
bd4f6f0b7d Move next_disambiguator to Resolver 2020-06-21 23:49:06 +01:00
marmeladema
1d3f49f536 Always create a root definition when creating a new Definitions object. 2020-06-21 23:13:31 +01:00
marmeladema
f60513ec8d Move remaining NodeId APIs from Definitions to Resolver 2020-06-21 23:13:31 +01:00
bors
1a4e2b6f9c Auto merge of #73180 - matthewjasper:predicate-cache, r=nikomatsakis
Cache flags and escaping vars for predicates

With predicates becoming interned (rust-lang/compiler-team#285) this is now possible and could be a perf win. It would become an even larger win once we have recursive predicates.

cc @lcnr @nikomatsakis

r? @ghost
2020-06-21 21:05:57 +00:00
LeSeulArtichaut
ae71e965dc Do not send a notification for P-high stable regressions
Add comment to clarify the pattern
2020-06-21 22:16:53 +02:00
Amanieu d'Antras
8d0e882065 Fix handling of reserved registers for ARM inline asm 2020-06-21 20:10:19 +01:00
Ralf Jung
cb8c94c523
improve grammar
Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
2020-06-21 21:01:28 +02:00
Ralf Jung
7447bf2201 fmt 2020-06-21 19:35:57 +02:00
bors
a8cf399117 Auto merge of #72936 - jackh726:chalk-more, r=nikomatsakis
Upgrade Chalk

Things done in this PR:
- Upgrade Chalk to `0.11.0`
- Added compare-mode=chalk
- Bump rustc-hash in `librustc_data_structures` to `1.1.0` to match Chalk
- Removed `RustDefId` since the builtin type support is there
- Add a few more `FIXME(chalk)`s for problem spots I hit when running all tests with chalk
- Added some more implementation code for some newer builtin Chalk types (e.g. `FnDef`, `Array`)
- Lower `RegionOutlives` and `ObjectSafe` predicates
- Lower `Dyn` without the region
- Handle `Int`/`Float` `CanonicalVarKind`s
- Uncomment some Chalk tests that actually work now
- Remove the revisions in `src/test/ui/coherence/coherence-subtyping.rs` since they aren't doing anything different

r? @nikomatsakis
2020-06-21 17:10:09 +00:00
Ralf Jung
629722893c MIR validation: check switch_ty 2020-06-21 18:24:51 +02:00
Ralf Jung
3bfd0c9f07 remove switch_ty reliance in codegen 2020-06-21 18:22:30 +02:00
Dan Aloni
fea5ab12c2 Prefer accessible paths in 'use' suggestions
This fixes an issue with the following sample:

    mod foo {
	mod inaccessible {
	    pub struct X;
	}
	pub mod avail {
	    pub struct X;
	}
    }

    fn main() { X; }

Instead of suggesting both `use crate::foo::inaccessible::X;` and `use
crate::foo::avail::X;`, it should only suggest the latter.

It is done by trimming the list of suggestions from inaccessible paths
if accessible paths are present.

Visibility is checked with `is_accessible_from` now instead of being
hard-coded.

-

Some tests fixes are trivial, and others require a bit more explaining,
here are my comments:

src/test/ui/issues/issue-35675.stderr: Only needs to make the enum
public to have the suggestion make sense.

src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't
help because its constructor is not visible, so the attempted
constructor does not work. In that case, it's better not to suggest it.
The case where the constructor is public is covered in `issue-26545.rs`.
2020-06-21 18:49:39 +03:00
Youngsuk Kim
893077ca76
Update src/librustc_mir/monomorphize/collector.rs
typo fix

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-06-21 11:43:30 -04:00
Guillaume Gomez
c14d85fd33 Update UI tests 2020-06-21 16:40:36 +02:00
Ralf Jung
726b6f4a69 Miri: replace many bug! by span_bug! 2020-06-21 16:13:31 +02:00
bors
349f6bfb11 Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum
Enable LLVM zlib

Compilers may generate ELF objects with compressed sections (although rustc currently doesn't do this). Currently, when linking these with `rust-lld`, you'll get this error:

`rust-lld: error: ...: contains a compressed section, but zlib is not available`

This enables zlib when building LLVM.
2020-06-21 13:18:00 +00:00
Guillaume Gomez
a657be42b1 Create E0765 error for unterminated double quote strings 2020-06-21 14:09:12 +02:00
Ralf Jung
467415d50c deprecate wrapping_offset_from 2020-06-21 13:50:06 +02:00
Oliver Scherer
e465b227d1 icmp can handle raw pointers just fine, there's no need to cast to int. 2020-06-21 13:17:05 +02:00
Ralf Jung
55d207a44f tweak wording 2020-06-21 12:23:37 +02:00
Ralf Jung
7cac20995e add missing doc links 2020-06-21 12:21:38 +02:00
VillSnow
c9b4915705 fix: doc test 2020-06-21 18:54:55 +09:00
Ralf Jung
b92602ba69 Make is_freeze and is_copy_modulo_regions take TyCtxtAt 2020-06-21 11:47:19 +02:00
Ralf Jung
1c74ab4226 Make is_freeze and is_copy_modulo_regions take TyCtxtAt 2020-06-21 11:47:19 +02:00
bors
7adbc0dfef Auto merge of #73546 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/73405
Cc @rust-lang/miri r? @ghost
2020-06-21 09:28:26 +00:00
Matthew Jasper
6e12272af0 Replace is_global call on data with call on predicate 2020-06-21 10:22:21 +01:00
Matthew Jasper
f802ee1f59 Cache flags and escaping vars for predicates
Also hash predicates by address
2020-06-21 10:22:21 +01:00
Matthew Jasper
8ea55f1a99 Cache decoded predicate shorthands 2020-06-21 10:18:01 +01:00
Johannes Schilling
e3d735dcbf Fix typo in error_codes doc 2020-06-21 10:22:19 +02:00
bors
38bd83df88 Auto merge of #71911 - wesleywiser:const_prop_small_cleanups, r=oli-obk
[mir-opt] Small ConstProp cleanup
2020-06-21 05:56:26 +00:00
VillSnow
4c8ce48a15 Add partition_point 2020-06-21 13:52:26 +09:00
Youngsuk Kim
63740548aa
Fix typos in doc comments
This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
2020-06-20 22:53:51 -04:00
bors
228a0ed7b0 Auto merge of #70946 - jumbatm:clashing-extern-decl, r=nagisa
Add a lint to catch clashing `extern` fn declarations.

Closes #69390.

Adds lint `clashing_extern_decl` to detect when, within a single crate, an extern function of the same name is declared with different types. Because two symbols of the same name cannot be resolved to two different functions at link time, and one function cannot possibly have two types, a clashing extern declaration is almost certainly a mistake.

This lint does not run between crates because a project may have dependencies which both rely on the same extern function, but declare it in a different (but valid) way. For example, they may both declare an opaque type for one or more of the arguments (which would end up distinct types), or use types that are valid conversions in the language the extern fn is defined in. In these cases, we can't say that the clashing declaration is incorrect.

r? @eddyb
2020-06-21 02:20:07 +00:00
Adrian Taylor
a63eb3c678 Clarify --extern documentation.
Fixes #64731, #73531.

See also #64402#issuecomment-530852886
2020-06-20 17:02:18 -07:00
David Tolnay
4896a06667
Update stability attribute of new Vec PartialEq impls 2020-06-20 16:02:21 -07:00
bors
7058471ade Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #72456 (Try to suggest dereferences on trait selection failed)
 - #72788 (Projection bound validation)
 - #72790 (core/time: Add Duration methods for zero)
 - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options)
 - #73287 (lint: normalize projections using opaque types)
 - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs)
 - #73378 (Remove use of specialization from librustc_arena)
 - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15))
 - #73443 (ci: allow gating GHA on everything but macOS)

Failed merges:

r? @ghost
2020-06-20 22:53:46 +00:00
Solomon Ucko
fc60282dae
impl PartialEq<Vec<B>> for &[A], &mut [A] 2020-06-20 15:51:20 -07:00
Manish Goregaokar
929f032742
Rollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simulacrum
ci: allow gating GHA on everything but macOS

In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures.

cc https://github.com/rust-lang/rust-central-station/issues/848
r? @Mark-Simulacrum
2020-06-20 14:45:04 -07:00
Manish Goregaokar
9a82736e94
Rollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)

Pulls in changes from #73326.

Closes #73286
2020-06-20 14:45:02 -07:00
Manish Goregaokar
a876a5adcf
Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk
Remove use of specialization from librustc_arena

This reworks the macro so that specialization, `transmute` and `#[marker]` are not used.

r? @oli-obk
2020-06-20 14:45:00 -07:00
Manish Goregaokar
0a8fd43e2d
Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petrochenkov
Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs

cc #50928

I don't know who is exactly the best person to review this.

r? @petrochenkov
2020-06-20 14:44:58 -07:00
Manish Goregaokar
9003087655
Rollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projections, r=estebank
lint: normalize projections using opaque types

Fixes #73251.

This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).
2020-06-20 14:44:57 -07:00