When a ui-fulldeps comparison fails it suggests running
update-references.sh:
```
src/test/ui-fulldeps/update-references.sh 'rust/build/x86_64-apple-darwin/test/ui-fulldeps' 'resolve-error.rs'
```
This does not work as update-references.sh isn't executable. The other
update-references.sh in the ui directory is already executable so this looks
like an oversight.
Properly parse impls for the never type `!`
Recover from missing `for` in `impl Trait for Type`
Prohibit inherent default impls and default impls of auto traits
Change wording in more diagnostics to use "auto traits"
Some minor code cleanups in the parser
Use correct line offsets for doctests
Not yet tested.
This doesn't handle char positions. It could if I collected a map of char offsets and lines, but this is a bit more work and requires hooking into the parser much more (unsure if it's possible).
r? @QuietMisdreavus
(fixes#45868)
Implement libstd for CloudABI.
Though CloudABI is strongly inspired by POSIX, its absence of features that don't work well with capability-based sandboxing makes it different enough that adding bits to `sys/unix` will make things a mess. This change therefore adds CloudABI specific platform code under `sys/cloudabi`.
One of the goals of this implementation is to build as much as possible directly on top of CloudABI's system call layer, as opposed to using the C library. This is preferred, as the system call layer is supposed to be stable, whereas the C library ABI technically is not. An advantage of this approach is that it allows us to implement certain interfaces, such as mutexes and condition variables more optimally. They can be lighter than the ones provided by pthreads.
This change disables some modules that cannot realistically be implemented right now. For example, libstd's pathname abstraction is not designed with POSIX `*at()` (e.g., `openat()`) in mind. The `*at()` functions are the only set of file system APIs available on CloudABI. There is no global file system namespace, nor a process working directory. Discussions on how to port these modules over are outside the scope of this change.
rustc: Tweak `#[target_feature]` syntax
This is an implementation of the `#[target_feature]` syntax-related changes of
[RFC 2045][rfc]. Notably two changes have been implemented:
* The new syntax is `#[target_feature(enable = "..")]` instead of
`#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+`
to indicate that a feature is being enabled, and a sub-list is used for
possible expansion in the future. Additionally within this syntax the feature
names being enabled are now whitelisted against a known set of target feature
names that we know about.
* The `#[target_feature]` attribute can only be applied to unsafe functions. It
was decided in the RFC that invoking an instruction possibly not defined for
the current processor is undefined behavior, so to enable this feature for now
it requires an `unsafe` intervention.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
the match-checking code used to use TyErr for signaling "unknown,
inhabited" types for a long time. It had been switched to using the
exact type in #38069, to handle uninhabited types.
However, in #39980, we discovered that we still needed the "unknown
inhabited" logic, but I used `()` instead of `TyErr` to handle that.
Revert to using `TyErr` to fix that problem.
This is an implementation of the `#[target_feature]` syntax-related changes of
[RFC 2045][rfc]. Notably two changes have been implemented:
* The new syntax is `#[target_feature(enable = "..")]` instead of
`#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+`
to indicate that a feature is being enabled, and a sub-list is used for
possible expansion in the future. Additionally within this syntax the feature
names being enabled are now whitelisted against a known set of target feature
names that we know about.
* The `#[target_feature]` attribute can only be applied to unsafe functions. It
was decided in the RFC that invoking an instruction possibly not defined for
the current processor is undefined behavior, so to enable this feature for now
it requires an `unsafe` intervention.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
No longer parse it.
Remove AutoTrait variant from AST and HIR.
Remove backwards compatibility lint.
Remove coherence checks, they make no sense for the new syntax.
Remove from rustdoc.
Remove deprecated unstable attribute #[simd]
The `#[simd]` attribute has been deprecated since c8b6d5b23c back in 2015. Any nightly crates using it have had ample time to switch to `#[repr(simd)]`, and if they didn't they're likely broken by now anyway.
r? @eddyb
`struct` pattern parsing and diagnostic tweaks
- Recover from struct parse error on match and point out missing match
body.
- Point at struct when finding non-identifier while parsing its fields.
- Add label to "expected identifier, found {}" error.
Fix#15980.