Commit graph

122801 commits

Author SHA1 Message Date
Alexis Bourget
3c46e36d39 Document the mut keyword 2020-06-22 16:27:23 +02:00
Niko Matsakis
4199b3ae26 Revert "modify leak-check to track only outgoing edges from placeholders"
This reverts commit 2e01db4b396a1e161f7a73933fff34bc9421dba0.
2020-06-22 14:05:00 +00:00
Niko Matsakis
bcc0a9c8eb modify leak-check to track only outgoing edges from placeholders
Also, update the affected tests. This seems strictly better but it is
actually more permissive than I initially intended. In particular it
accepts this

```
forall<'a, 'b> {
  exists<'intersection> {
    'a: 'intersection,
    'b: 'intersection,
  }
}
```

and I'm not sure I want to accept that. It implies that we have a
`'empty` in the new universe intoduced by the `forall`.
2020-06-22 14:05:00 +00:00
Alexis Bourget
9766a93163 Document the mod keyword 2020-06-22 15:36:09 +02:00
bors
62878c20e9 Auto merge of #73617 - Dylan-DPC:rollup-zugh80o, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #71660 (impl PartialEq<Vec<B>> for &[A], &mut [A])
 - #72623 (Prefer accessible paths in 'use' suggestions)
 - #73502 (Add E0765)
 - #73580 (deprecate wrapping_offset_from)
 - #73582 (Miri: replace many bug! by span_bug!)
 - #73585 (Do not send a notification for P-high stable regressions)

Failed merges:

 - #73581 (Create 0766 error code)

r? @ghost
2020-06-22 12:59:57 +00:00
Dylan DPC
c5e6f48544
Rollup merge of #73585 - LeSeulArtichaut:patch-3, r=Mark-Simulacrum
Do not send a notification for P-high stable regressions

This is kind of a hack to only match nightly and beta regressions, but not stable regressions. See my tests [on the playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6ff8a809162118aa2951f2ff12400067).

r? @spastorino cc @Mark-Simulacrum
2020-06-22 14:53:56 +02:00
Dylan DPC
cb85f4bce0
Rollup merge of #73582 - RalfJung:miri-span-bug, r=oli-obk
Miri: replace many bug! by span_bug!

r? @oli-obk
2020-06-22 14:53:54 +02:00
Dylan DPC
35ecb26297
Rollup merge of #73580 - RalfJung:deprecate-wrapping-offset-from, r=Amanieu
deprecate wrapping_offset_from

As per https://github.com/rust-lang/rust/issues/41079#issuecomment-433140733 which seems like a consensus.

r? @Amanieu
2020-06-22 14:53:52 +02:00
Dylan DPC
d22b80dc0c
Rollup merge of #73502 - GuillaumeGomez:add-e0764, r=estebank
Add E0765
2020-06-22 14:53:50 +02:00
Dylan DPC
fdd241f5b3
Rollup merge of #72623 - da-x:use-suggest-public-path, r=petrochenkov
Prefer accessible paths in 'use' suggestions

This PR addresses issue https://github.com/rust-lang/rust/issues/26454, where `use` suggestions are made for paths that don't work. For example:

```rust
mod foo {
    mod bar {
        struct X;
    }
}

fn main() { X; } // suggests `use foo::bar::X;`
```
2020-06-22 14:53:48 +02:00
Dylan DPC
8da1dd0215
Rollup merge of #71660 - sollyucko:master, r=dtolnay
impl PartialEq<Vec<B>> for &[A], &mut [A]

https://github.com/rust-lang/rfcs/issues/2917
2020-06-22 14:53:46 +02:00
Ivan Tham
314e621198 Liballoc minor hash import tweak 2020-06-22 20:52:02 +08:00
Bastian Kauschke
932237b101
fix intrinsics::needs_drop docs 2020-06-22 14:42:26 +02:00
VillSnow
8cc6998cd4 add: tests 2020-06-22 21:36:35 +09:00
VillSnow
27b06f10dc update: doc comment 2020-06-22 21:35:09 +09:00
Guillaume Gomez
c474317747 Clean up E0699 explanation 2020-06-22 11:50:55 +02:00
Ralf Jung
a593728fc7 make layout check a mere sanity check 2020-06-22 11:07:39 +02:00
David Wood
b60ec47a06
bootstrap: no config.toml exists regression
This commit fixes a regression introduced in #73317 where an oversight
meant that `config.toml` was assumed to exist.

Signed-off-by: David Wood <david@davidtw.co>
2020-06-22 10:02:00 +01:00
Ralf Jung
5e5ae8b087 expand a comment 2020-06-22 10:26:29 +02:00
Ralf Jung
7f8fe6a985 also use relator in interpreter assignment sanity check 2020-06-22 09:19:08 +02:00
Ralf Jung
7754322bcc fix typo
Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
2020-06-22 09:19:08 +02:00
Ralf Jung
91f73fbca4 use a TypeRelation to compare the types 2020-06-22 09:19:08 +02:00
Ralf Jung
978470f711 no need to normalize mutability any more 2020-06-22 09:19:08 +02:00
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