| Age | Commit message (Collapse) | Author | Lines |
|
(cherry picked from commit e7b02046a0b34ec6d114a7ba5549db8457684ec4)
|
|
Fix #71584, fix #69683.
(cherry picked from commit a7b03ad4eddb65abede497dbc408244f23c36256)
|
|
|
|
|
|
|
|
Fix #71798.
|
|
|
|
|
|
Make Box<dyn FnOnce> respect self alignment
Closes #68304
r? @eddyb @nikomatsakis
|
|
Check that main/start is not async
* Add new error code E0752
* Add span to hir::IsAsync::Yes
* Emit an error if main or the start function is marked as async
* Add two regression tests
This PR fixes #68523.
|
|
fix -Zast-json to output correct JSON form
fixes #71086 (Reverts some of the changes made in #70215)
JSON output (from an empty library) after fix has something for **"id"** field
```shell
lonelyjoe@lonelyjoe-desktop:~/workspace/empty_lib/src$ rustc lib.rs -Zast-json
```
```json
{
"module":{
"inner":{
"lo":0,
"hi":94
},
"items":[
{
"attrs":[
{
"kind":{
"variant":"Normal",
"fields":[
{
"path":{
"span":{
"lo":0,
"hi":0
},
"segments":[
{
"ident":{
"name":"prelude_import",
"span":{
"lo":0,
"hi":0
}
},
"id":3,
"args":null
}
]
},
"args":"Empty"
}
]
},
"id":null,
"style":"Outer",
"span":{
"lo":0,
"hi":0
}
}
],
"id":4,
"span":{
"lo":0,
"hi":0
},
"vis":{
"node":"Inherited",
"span":{
"lo":0,
"hi":0
}
},
"ident":{
"name":"",
"span":{
"lo":0,
"hi":0
}
},
"kind":{
"variant":"Use",
"fields":[
{
"prefix":{
"span":{
"lo":0,
"hi":0
},
"segments":[
{
"ident":{
"name":"{{root}}",
"span":{
"lo":0,
"hi":0
}
},
"id":5,
"args":null
},
{
"ident":{
"name":"std",
"span":{
"lo":0,
"hi":0
}
},
"id":6,
"args":null
},
{
"ident":{
"name":"prelude",
"span":{
"lo":0,
"hi":0
}
},
"id":7,
"args":null
},
{
"ident":{
"name":"v1",
"span":{
"lo":0,
"hi":0
}
},
"id":8,
"args":null
}
]
},
"kind":"Glob",
"span":{
"lo":0,
"hi":0
}
}
]
},
"tokens":null
},
{
"attrs":[
{
"kind":{
"variant":"Normal",
"fields":[
{
"path":{
"span":{
"lo":0,
"hi":0
},
"segments":[
{
"ident":{
"name":"macro_use",
"span":{
"lo":0,
"hi":0
}
},
"id":9,
"args":null
}
]
},
"args":"Empty"
}
]
},
"id":null,
"style":"Outer",
"span":{
"lo":0,
"hi":0
}
}
],
"id":10,
"span":{
"lo":0,
"hi":0
},
"vis":{
"node":"Inherited",
"span":{
"lo":0,
"hi":0
}
},
"ident":{
"name":"std",
"span":{
"lo":0,
"hi":0
}
},
"kind":{
"variant":"ExternCrate",
"fields":[
null
]
},
"tokens":null
}
],
"inline":true
},
"attrs":[
],
"span":{
"lo":0,
"hi":94
},
"proc_macros":[
]
}
```
|
|
* Add new error code E0752
* Add span to hir::IsAsync::Yes
* Emit an error if main or the start function is marked as async
* Add two regression tests
Fix formatting errors and bless test outputs
* move tests to ui/async-await
fix test error text
remove span from IsAsync
|
|
ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).
Oddly enough, we don't have any UI tests showing this off in types, only `mir-opt` tests.
However, the pretty form should show up in the test output diff of #71018, if this PR is merged first.
<hr/>
Examples of before/after:
|`Option<bool>`|
|:-:|
|`{transmute(0x01): std::option::Option<bool>}`|
| :sparkles: ↓↓↓ :sparkles: |
|`std::option::Option::<bool>::Some(true)`|
| `RawVec<u32>` |
|:-:|
| `ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }: alloc::raw_vec::RawVec::<u32>`|
| :sparkles: ↓↓↓ :sparkles: |
|`alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }`|
<hr/>
This PR is a prerequisite for #61486, *sort of*, in that we need to be able to pretty-print values in order to even consider how we might mangle them.
We still don't have pretty-printing for constants of reference types, @oli-obk has the necessary support logic in a PR but I didn't want to interfere with that.
<hr/>
Each commit should be reviewed separately, as I've fixed a couple deficiencies along the way.
r? @oli-obk cc @rust-lang/wg-mir-opt @varkor @yodaldevoid
|
|
|
|
Deprecate the asm! macro in favor of llvm_asm!
Since we will be changing the syntax of `asm!` soon, deprecate it and encourage people to use `llvm_asm!` instead (which preserves the old syntax). This will avoid breakage when `asm!` is changed.
RFC: https://github.com/rust-lang/rfcs/pull/2843
|
|
Fix some tests failing in `--pass check` mode
r? @RalfJung
|
|
miri-unleash test for llvm_asm
r? @oli-obk @ecstatic-morse
|
|
Do not show DefId in diagnostics
Fixes #71222
r? @estebank cc @eddyb
|
|
Fix false "never constructed" warnings for `Self::` variant paths
Closes #64362 .
|
|
|
|
|
|
Fixed missing trait method suggests incorrect code (self parameter not named "self").
fixes #71150
|
|
|
|
|
|
Make `needs_drop` less pessimistic on generators
Generators only have non-trivial drop logic when they may store (in upvars or across yields) a type that does.
This prevents generation of some unnecessary MIR in simple generators. There might be some impact on compile times, but this is probably limited in real-world applications.
~~This builds off of https://github.com/rust-lang/rust/pull/69814 since that contains some fixes that are made relevant by *this* PR (see https://github.com/rust-lang/rust/pull/69814#issuecomment-599147269).~~ (this has been merged)
|
|
Maintain chain of derived obligations
When evaluating the derived obligations from super traits, maintain a
reference to the original obligation in order to give more actionable
context in the output.
Continuation (and built on) #69745, subset of #69709.
r? @eddyb
|
|
|
|
|
|
|
|
|
|
When evaluating the derived obligations from super traits, maintain a
reference to the original obligation in order to give more actionable
context in the output.
|
|
miri-unleashed: test that we detect heap allocations
This removes the second-to-last use of `IS_SUPPORTED_IN_MIRI = false`.
r? @ecstatic-morse @oli-obk
|
|
|
|
outlives: ignore lifetimes shallowly found in `ty::FnDef`s.
Fixes #70917 by restoring the pre-#70164 behavior for now.
r? @nikomatsakis
|
|
|
|
Update the minimum external LLVM to 8
LLVM 8 was released on March 20, 2019, over a year ago.
|
|
Account for use of `try!()` in 2018 edition and guide users in the right direction
fixes #71155
|
|
Use `call` instead of `invoke` for functions that cannot unwind
The `FnAbi` now knows if the function is allowed to unwind. If a
function isn't allowed to unwind, we can use a `call` instead of an
`invoke`.
This resolves an issue when calling LLVM intrinsics which cannot unwind
LLVM will generate an error if you attempt to invoke them so we need to
ignore cleanup blocks in codegen and generate a call instead.
Fixes #69911
r? @eddyb
cc @rust-lang/wg-ffi-unwind
|
|
|
|
|
|
Rename `asm` test directory in favor of `llvm_asm`
r? @Amanieu
|
|
Use query to determine whether function needs const checking
Resolves #69615.
The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account.
r? @oli-obk
|
|
|
|
direction
|
|
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it.
By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output).
This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now.
r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
|
|
|
|
rustc_target::abi: add Primitive variant to FieldsShape.
Originally suggested by @eddyb.
|
|
Rollup of 7 pull requests
Successful merges:
- #70578 (Add long error explanation for E0657)
- #70910 (Hides default fns inside Fuse impl to avoid exposing it to any crate)
- #71164 (reword Miri validity errors: undefined -> uninitialized)
- #71182 (Add some regression tests)
- #71206 (Miri error messages: avoid try terminology)
- #71220 (Dogfood or_patterns in the standard library)
- #71225 (Fix typo in Default trait docs: Provides -> Provide)
Failed merges:
r? @ghost
|
|
|
|
|