Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Adding a private field to a struct containing only public fields is a breaking change #43

Open
zdimension opened this issue Jun 6, 2022 · 0 comments
Assignees
Labels
bug Something isn't working rustdoc-backend

Comments

@zdimension
Copy link

zdimension commented Jun 6, 2022

Currently, only public fields are fetched using Rustdoc, but adding a private field can be a breaking change:

pub struct Foo(pub bar: u8, pub baz: u8);
// ↓
pub struct Foo(pub bar: u8, pub baz: u8, boo: u8);

will break structure literals:

let x = the_crate::Foo { bar: 12, baz: 34 }; // breaks!

Note that this is breaking only if the struct does not already contain a private field, because in that case no existing code can rely on constructs such as struct literals.

See RFC 1105 for more information on breaking changes in types.

@zdimension zdimension added bug Something isn't working rustdoc-backend labels Jun 6, 2022
@zdimension zdimension self-assigned this Jun 6, 2022
@zdimension zdimension changed the title Adding a private field to an all-public struct is a breaking change Adding a private field to a struct containing only public fields is a breaking change Jun 6, 2022
zdimension added a commit that referenced this issue Jul 8, 2022
Bump version

Clean up code

Initial comparison works

Add deprecation

Handle enum variants

Add tests

Cargo fix

Clean up code

Remove old git module

Clean up code

Better error handling

Handle methods (for later)

Add Display for rustdoc objects

Fix rustdoc call for impls

Add method metadata type

Update types.rs

It just works

Remove redundant method

fix+fmt

Remove leftover glue crate code

Update glue.rs

clippy

remove redundant lines from output

fmt

Build lib

Optional type resolution

Try add nightly to workflow

angry clippy

Update types.rs

Handle removal of private fields (fixes #43)

Update rustdoc_types to 0.11.0

Fix typo in name

Remove leftover argument

Better arg help

Delete leftover files

Remove leftover commented code

Remove unused fields

Add verbosity and quiet options

Add support for external config and arguments loading (file, environment) for #33

Handle quiet flag

Fix argument handling

Unordered vec comparison

Remove trait_impl field

Add breaking field

Show commit info in debug

fmt

Make item kind part of path (support different-kinded items with identical path)

Fix turbofish

Update tests to match new notation

Fix assoc types in impls

Fmt

Add feature flag support for Cargo build

Update README.md
Update README.md

Remove old unused deps

Add --package parameter for workspaces

Fmt

Unused import
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working rustdoc-backend
Projects
None yet
Development

No branches or pull requests

1 participant