Commit graph

123660 commits

Author SHA1 Message Date
Mark Rousskov
6c50ae898b Bump to 1.47 2020-07-16 19:36:49 -04:00
Jakub Kądziołka
2ff13d9cf1
Use an UTF-8 locale for the linker. 2020-07-17 01:09:52 +02:00
Kristofer Rye
ab23a2a9c5
ci: Set shell: bash as a default, remove duplicates
A follow-up to #74406, this commit merely removes the `shell: bash`
lines where they are explicitly added in favor of setting defaults for
*all* "run" steps.

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
2020-07-16 18:06:31 -05:00
Aman Arora
50f3dbd121 Move hir::Place to librustc_middle/hir
Needed to support https://github.com/rust-lang/project-rfc-2229/issues/7

Currently rustc_typeck depends on rustc_middle for definition TypeckTables, etc.
For supporting project-rfc-2229#7, rustc_middle would've to depend on
rustc_typeck for Place -- introducing a circular dependcy.

This resembles the MIR equivalent of `Place` located in `lbrustc_middle/mir`.

Co-authored-by: Aman Arora <me@aman-arora.com>
Co-authored-by: Jennifer Wills <wills.jenniferg@gmail.com>
Co-authored-by: Logan Mosier <logmosier@gmail.com>
2020-07-16 18:57:03 -04:00
Nicholas Nethercote
a4ba18164a Remove some Symbol:as_str() calls. 2020-07-17 08:29:58 +10:00
Nicholas Nethercote
f03c7f83eb Add UnsafetyViolationDetails.
This replaces the need for the `description` and `details` symbols in
`UnsafetyViolation`, which are static. As a result some
`Symbol::as_str()` calls are no longer necessary, which is nice.
2020-07-17 08:28:22 +10:00
Nicholas Nethercote
002af4d0c7 Avoid storing SymbolStr in a struct.
It's intended only for very temporary use.
2020-07-17 08:28:22 +10:00
Nicholas Nethercote
9f0080801d Remove ExtCtxt::ident_of.
It's equivalent to `Ident::from_str_and_span`. The commit also
introduces some more static symbols so that `Ident::new` can be used in
various places instead of `Ident::from_str_and_span`.

The commit also changes `Path::path` from a `&str` to a `Symbol`, which
then allows the lifetime annotation to be removed from `Ty`. Also, the
use of `Symbol` in `Bounds` removes the need for its lifetime
annotation.
2020-07-17 08:28:19 +10:00
Joshua Nelson
c46e0386c5 Fix invalid lint
intra_doc_resolution_failure is not a lint.
2020-07-16 18:26:58 -04:00
Joshua Nelson
8387e3825f Add (broken and ignored) test for #73829 2020-07-16 18:26:58 -04:00
Joshua Nelson
0ad1dcd6a0 Add more debugging 2020-07-16 18:26:58 -04:00
Joshua Nelson
82b3b0705b Support intra-doc links on trait and module re-exports
Trait implementations are treated the same as modules for the purposes
of intra-doc links.
2020-07-16 18:26:58 -04:00
Joshua Nelson
e63e5cdab0 Support intra-doc links on macro re-exports
This includes both `macro_rules!` and proc-macros.
2020-07-16 18:26:58 -04:00
Joshua Nelson
5f49f55eb4 rand -> my_rand
This fixes a failure in stage2 rustdoc tests.
2020-07-16 18:26:58 -04:00
Joshua Nelson
769acbaca0 #![deny(intra_doc_resolution_failure)] 2020-07-16 18:26:58 -04:00
Joshua Nelson
432b0431ab Move import to top of function 2020-07-16 18:26:58 -04:00
Joshua Nelson
71fe8f7cd8 Add test for submodules in inner crate 2020-07-16 18:26:58 -04:00
Joshua Nelson
9eb63945eb Add test for documenting the re-export 2020-07-16 18:26:58 -04:00
Joshua Nelson
e78d499637 Add test for re-exports
I had a hard time getting this to work without the `extern crate`,
suggestions are welcome.
2020-07-16 18:26:57 -04:00
Joshua Nelson
99f34d814e Remove warnings 2020-07-16 18:26:57 -04:00
Joshua Nelson
9542e23a7d Add tests for basic intra-doc links 2020-07-16 18:26:57 -04:00
Joshua Nelson
24c3d85e66 Make sure that module_id is actually a module 2020-07-16 18:26:57 -04:00
Joshua Nelson
20106d5a2f unwrap() -> expect() 2020-07-16 18:26:57 -04:00
Joshua Nelson
c3d9a730b7 Don't panic on fake IDs 2020-07-16 18:26:57 -04:00
Joshua Nelson
69bd13f233 Use DefId for modules 2020-07-16 18:26:57 -04:00
Joshua Nelson
848a766e24 Use the scope of the imported variable for resolution, not the current scope
- Accept DefId in resolve_str_path_error

This will probably break lots of internal invariants.
2020-07-16 18:26:57 -04:00
Joshua Nelson
5271e98f4e Use get_module instead of module_map for resolve_str_path_error 2020-07-16 18:26:57 -04:00
Nicholas Nethercote
bccff14a20 Simplify LifetimeBounds.
The `lifetimes` field is always empty. This commit removes it, and
renames the type as `Bounds`.
2020-07-17 07:32:15 +10:00
Nicholas Nethercote
8e92f4fb91 Remove unused cx parameter from pathvec_std and path_std. 2020-07-17 07:32:15 +10:00
Ashley Mannix
1f1cda65d9 appease tidy 2020-07-17 07:25:32 +10:00
Ashley Mannix
d1017940d7 remove inlined lazy::Waiter in favor of sync::Once 2020-07-17 07:25:32 +10:00
Ashley Mannix
d1263f5e66 use set() in SyncOnceCell::from 2020-07-17 07:25:32 +10:00
Ashley Mannix
237a97760a integrate Lazy into std layout
This commit refactors the initial implementation to fit into std and
makes some other changes:

- use MaybeUninit internally in SyncOnceCell
- correctly impl Drop for lazy::Once
- port Lazy::take from once_cell from: https://github.com/matklad/once_cell/pull/100

Co-Authored-By: Paul Dicker <pitdicker@users.noreply.github.com>
2020-07-17 07:25:32 +10:00
Aleksey Kladov
cac1768b03 First cut of std::lazy module 2020-07-17 07:23:49 +10:00
Jonas Schievink
209991f8b2 Don't assign () to ! MIR locals 2020-07-16 23:09:51 +02:00
Guillaume Gomez
5f6c07937a Set "invalid_codeblock_attributes" lint to warning level by default 2020-07-16 22:42:18 +02:00
bors
5c9e5df3a0 Auto merge of #74408 - Manishearth:rollup-9gxn4od, r=Manishearth
Rollup of 21 pull requests

Successful merges:

 - #73566 (Don't run `everybody_loops` for rustdoc; instead ignore resolution errors)
 - #73771 (Don't pollute docs/suggestions with libstd deps)
 - #73794 (Small cleanup for E0705 explanation)
 - #73807 (rustdoc: glue tokens before highlighting)
 - #73835 (Clean up E0710 explanation)
 - #73926 (Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64)
 - #73981 (Remove some `ignore-stage1` annotations.)
 - #73998 (add regression test for #61216)
 - #74140 (Make hir ProjectionKind more precise)
 - #74148 (Move #[doc(alias)] check in rustc)
 - #74159 (forbid generic params in the type of const params)
 - #74171 (Fix 44056 test with debug on macos.)
 - #74221 (Don't panic if the lhs of a div by zero is not statically known)
 - #74325 (Focus on the current file in the source file sidebar)
 - #74359 (rustdoc: Rename internal API fns to `into_string`)
 - #74370 (Reintroduce spotlight / "important traits" feature)
 - #74390 (Fix typo in std::mem::transmute documentation)
 - #74391 (BtreeMap: superficially refactor root access)
 - #74392 (const generics triage)
 - #74397 (Fix typo in the latest release note)
 - #74406 (Set shell for github actions CI)

Failed merges:

r? @ghost
2020-07-16 19:01:48 +00:00
Manish Goregaokar
ff685f51f4
Rollup merge of #74406 - Mark-Simulacrum:fix-windows-maybe, r=Mark-Simulacrum
Set shell for github actions CI

r? @pietroalbini but because this seems at worst harmless and CI is broken self approving
2020-07-16 11:19:04 -07:00
Manish Goregaokar
043914ff68
Rollup merge of #74397 - rhysd:patch-1, r=jonas-schievink
Fix typo in the latest release note
2020-07-16 11:19:02 -07:00
Manish Goregaokar
c354524254
Rollup merge of #74392 - lcnr:const-generics-update, r=varkor
const generics triage

I went through all const generics issues and closed all issues which are already fixed.

Some issues already have a regression test but were not closed. Also doing this as part of this PR.

uff r? @eddyb @varkor

closes #61936
closes #62878
closes #63695
closes #67144
closes #68596
closes #69816
closes #70217
closes #70507
closes #70586
closes #71348
closes #71805
closes #73120
closes #73508
closes #73730
closes #74255
2020-07-16 11:19:00 -07:00
Manish Goregaokar
8f3b0ecf31
Rollup merge of #74391 - ssomers:btree_refactor, r=Mark-Simulacrum
BtreeMap: superficially refactor root access

Remove or comment every unwrap in BTreeMap's main code and more.

r? @Mark-Simulacrum
2020-07-16 11:18:59 -07:00
Manish Goregaokar
f821109ee2
Rollup merge of #74390 - ColoredCarrot:patch-1, r=lcnr
Fix typo in std::mem::transmute documentation

`u32::from_ge_bytes` function does not exist; replace with `u32::from_be_bytes`.
It is clear that `u32::from_le_bytes` is not meant from the context; the latter is used correctly while `from_be_bytes` is misspelled.
2020-07-16 11:18:57 -07:00
Manish Goregaokar
fc098170ce
Rollup merge of #74370 - Manishearth:re-spotlight, r=GuillaumeGomez
Reintroduce spotlight / "important traits" feature

(Reopened version of https://github.com/rust-lang/rust/pull/74111 because Github is broken, see discussion there)

Fixes https://github.com/rust-lang/rust/issues/73785

This PR reintroduces the "spotlight" ("important traits") feature.

A couple changes have been made:

As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side.

It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble.

![image](https://user-images.githubusercontent.com/1617736/86674555-a82d2600-bfad-11ea-9a4a-a1a9ffd66ae5.png)

![image](https://user-images.githubusercontent.com/1617736/86674533-a1061800-bfad-11ea-9e8a-c62ad86ed0d7.png)

It also works fine on mobile:

![image](https://user-images.githubusercontent.com/1617736/86674638-bda25000-bfad-11ea-8d8d-1798b608923e.png)
2020-07-16 11:18:55 -07:00
Manish Goregaokar
61fccf05f9
Rollup merge of #74359 - lzutao:rustdoc-tostring, r=GuillaumeGomez
rustdoc: Rename internal API fns to `into_string`

to avoid surprising listed in API guidelines.
2020-07-16 11:18:53 -07:00
Manish Goregaokar
196243ed9b
Rollup merge of #74325 - GuillaumeGomez:focus-source-file-sidebar, r=kinnison
Focus on the current file in the source file sidebar

Fixes #73360.

r? @kinnison
cc @rust-lang/rustdoc
2020-07-16 11:18:52 -07:00
Manish Goregaokar
a80559f472
Rollup merge of #74221 - oli-obk:const_prop_ice, r=wesleywiser
Don't panic if the lhs of a div by zero is not statically known

Fixes #73993 for real this time

r? @wesleywiser
2020-07-16 11:18:50 -07:00
Manish Goregaokar
5d5455bf3d
Rollup merge of #74171 - ehuss:44056-debug-macos, r=nikomatsakis
Fix 44056 test with debug on macos.

The test `codegen/issue-44056-macos-tls-align.rs` fails on macos if `debug-assertions` is enabled in `config.toml`.  It has the following error:

```
/Users/eric/Proj/rust/rust/src/test/codegen/issue-44056-macos-tls-align.rs:9:11: error: CHECK: expected string not found in input
// CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
          ^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:1:1: note: scanning from here
; ModuleID = 'issue_44056_macos_tls_align.3a1fbbbh-cgu.0'
^
/Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:9:1: note: possible intended match here
@STATIC_VAR_1 = thread_local global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
^
```

Comparing the output, the actual output is missing the text "`local_unnamed_addr`".

The fix here is to ignore `local_unnamed_addr`, as it doesn't seem relevant to the test.
2020-07-16 11:18:48 -07:00
Manish Goregaokar
6ef0dfa42f
Rollup merge of #74159 - lcnr:const-generic-ty-decl, r=varkor
forbid generic params in the type of const params

implements and closes #74152

fixes #74101, closes #71169, fixes #73491, closes #62878

@eddyb and I talked [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/type.20of.20const.20parameters/near/203405696) about this and we probably want to also forbid generic consts in the default
type of a parameter, e.g. `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`, this is currently still allowed
and I will probably fix that in a followup PR.

r? @varkor @eddyb
2020-07-16 11:18:46 -07:00
Manish Goregaokar
61a3f6701b
Rollup merge of #74148 - GuillaumeGomez:doc-alias-check, r=Manishearth
Move #[doc(alias)] check in rustc

Part of #73721.

r? @ollie27
2020-07-16 11:18:44 -07:00
Manish Goregaokar
ef3900090e
Rollup merge of #74140 - sexxi-goose:precise_hir_projections, r=nikomatsakis
Make hir ProjectionKind more precise

This commit also categorizing access as Field, Index, or Subslice.

Ideas are taken from `mir::ProjectionElem`.

Proposed changes: https://github.com/rust-lang/project-rfc-2229/blob/master/hir-place-target.md

Closes: https://github.com/rust-lang/project-rfc-2229/issues/1,
Closes: https://github.com/rust-lang/project-rfc-2229/issues/2

r? @nikomatsakis @matthewjasper
2020-07-16 11:18:42 -07:00