Fix mailmap duplicates, Carol and Brian.
This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.
Automaticaly calculate beta prerelease numbers
This is a forward-port of:
* 9426dda83d7a928d6ced377345e14b84b0f11c21
* cbfb9858951da7aee22d82178405306fca9decb1
from the beta branch which is used to automatically calculate the beta number
based on the number of merges to the beta branch so far.
Only link res_init() on GNU/*nix
To workaround a bug in glibc <= 2.26 lookup_host() calls res_init() based on the glibc version detected at runtime. While this avoids calling res_init() on platforms where it's not required we will still end up linking against the symbol.
This causes an issue on macOS where res_init() is implemented in a separate library (libresolv.9.dylib) from the main libc. While this is harmless for standalone programs it becomes a problem if Rust code is statically linked against another program. If the linked program doesn't already specify -lresolv it will cause the link to fail. This is captured in issue #46797
Fix this by hooking in to the glibc workaround in `cvt_gai` and only activating it for the "gnu" environment on Unix This should include all glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.
This has the side benefit of removing the #[cfg] in sys_common; only unix.rs has code related to the workaround now.
Before this commit:
```shell
> cat main.rs
use std::net::ToSocketAddrs;
#[no_mangle]
pub extern "C" fn resolve_test() -> () {
let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap();
println!("{:?}", addr_list);
}
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
Undefined symbols for architecture x86_64:
"_res_9_init", referenced from:
std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
```
Afterwards:
```shell
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
> ./combined
IntoIter([V4(172.217.25.131:0)])
```
Fixes #46797
Tweaks to invalid ctor messages
- Do not suggest using a constructor that isn't accessible
- Suggest the appropriate syntax (`()`/`{}` as appropriate)
- Add note when trying to use `Self` as a ctor
CC #22488, fix#47085.
check_match: fix handling of privately uninhabited types
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.
Fixes#46964.
r? @nikomatsakis
remove bogus assertion and comments
The code (incorrectly) assumed that constants could not have generics
in scope, but it's not really a problem if they do.
Fixes#47153
r? @pnkfelix
Closure argument mismatch tweaks
- use consistent phrasing for expected and found arguments
- suggest changing arguments to tuple if possible
- suggest changing single tuple argument to arguments if possible
Fix#44150.
Give TargetOptions::linker a sane default value for CloudABI.
Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.
Fix the "Github - About Pull Requests" link in CONTRIBUTING.md
Previously the text that is supposed to link to the Github Pull Requests page, instead linked to the same file (CONTRIBUTING.md).
add target/ to ignored tidy dirs
Sometimes you get a target directory from running cargo in the rust repo (the root is `src/`), and it contains generated files. Just whitelist it since it causes tidy to spew warnings uncontrollably.
add Rust By Example to the bookshelf
cc #46194
With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.
Add transpose conversions for nested Option and Result
These impls are useful when working with combinator
methods that expect an option or a result, but you
have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>`
or vice versa.
add kbd style tag to main.css in rustdoc
Added css style for kbd tags so they actually look like keys.
Result preview and discussion was going on in #46900 .
It is currently allowed to perform such assignments when not making use
of NLL. NLL already does this right, but let's add a test in place to
ensure it never regresses.
Rename std::ptr::Shared to NonNull and stabilize it
This implements the changes proposed at https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629:
> * Rename `Shared<T>` to `NonNull<T>` and stabilize it. (Being in the `ptr` module is enough to say that it’s a pointer. I’m not very attached to this specific name though.)
> * Rename `Box<T>` methods ~~`from_unique`~~/`into_unique` to ~~`from_nonnull`~~/`into_nonnull` (or whatever names are deemed appropriate), replace `Unique<T>` with `NonNull<T>` in their signatures, and stabilize them.
> * Replace `Unique<T>` with `NonNull<T>` in the signatures of methods of the `Alloc` trait.
> * Mark `Unique` “permanently-unstable” by replacing remaining occurrences of `#[unstable(feature = "unique", issue = "27730")]` with:
>
> ```rust
> #[unstable(feature = "ptr_internals", issue = "0", reason = "\
> use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), \
> Send, and/or Sync")]
> ```
>
> (Maybe the `reason` string is only useful on the struct definition.) Ideally it would be made private to some crate instead, but it needs to be used in both liballoc and libstd.
> * (Leave `NonZero` and `Zeroable` unstable for now, and subject to future bikeshedding.)